Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Select the largest cell by byte count in a notebook
ResourceFunction["LargestCellObject"][] gives the CellObject for the largest cell in the current notebook. | |
ResourceFunction["LargestCellObject"][nbo] gives the CellObject for the largest cell in the NotebookObject nbo. | |
ResourceFunction["LargestCellObject"][{cellobj1,…}] chooses the largest cell object from a list. | |
ResourceFunction["LargestCellObject"][…,n] gives the n largest cells. |
Create a notebook with content:
| In[1]:= | ![]() |
| Out[1]= |
Select the largest cell by ByteCount:
| In[2]:= |
| Out[2]= |
| In[3]:= |

Find the largest cell in this notebook:
| In[4]:= |
| Out[4]= |
Find the ten largest cells in this notebook:
| In[5]:= |
| Out[5]= | ![]() |
Find the 10 cells before this one in this notebook:
| In[6]:= |
| Out[6]= | ![]() |
Select the largest one from that list:
| In[7]:= |
| Out[7]= |
Print the largest cell back out:
| In[8]:= |
| Out[5]= | ![]() |
Use the CellStyle option to limit the cells:
| In[9]:= | ![]() |
| Out[9]= |
Find the largest input cell:
| In[10]:= |
| Out[10]= |
Find the two largest input cells:
| In[11]:= |
| Out[11]= |
Find the largest output cell:
| In[12]:= |
| Out[12]= |
Omitting the count n gives the largest CellObject directly:
| In[13]:= |
| Out[13]= |
Giving 1 as the count gives the largest cell in a list:
| In[14]:= |
| Out[14]= |
Retrieve a notebook:
| In[15]:= |
| Out[15]= |
See the size:
| In[16]:= |
| Out[16]= |
Find the three largest output cells:
| In[17]:= |
| Out[17]= |
Replace the outputs with images:
| In[18]:= |
| Out[18]= |
The notebook is now much smaller:
| In[19]:= |
| Out[19]= |
| In[20]:= |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License