SelectedCells

SelectedCells[notebook]
returns a list of CellObject expressions corresponding to the currently selected cells in notebook.

SelectedCells[]
returns the currently selected cells in the notebook in which this function is being evaluated.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

Return a given selected cell:

In[1]:=
Click for copyable input
Out[1]=

Return an empty list if no cell is selected:

In[1]:=
Click for copyable input
Out[1]=

Return selected cells of a given notebook:

In[1]:=
Click for copyable input
Out[1]=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »