({{, (RefLink[CellLabel, paclet:ref/CellLabel])
is an option for (RefLink[Cell, paclet:ref/Cell]) which gives the label to use for a particular cell. }})

OpenersNotesSection(Spacer1)Details

(RefLink[CellLabel, paclet:ref/CellLabel])->"" specifies that no label should be used for a cell.

Cell labels are displayed when the setting (RefLink[ShowCellLabel, paclet:ref/ShowCellLabel])->(RefLink[True, paclet:ref/True]) is made. They may also be displayed in modified form with the setting (RefLink[ShowCellLabel, paclet:ref/ShowCellLabel])->(RefLink[Automatic, paclet:ref/Automatic]).

Cell labels are typically generated automatically when cells appear as input or output to the Wolfram Language kernel.

Cell labels are automatically deleted when a cell is modified or saved if (RefLink[CellLabelAutoDelete, paclet:ref/CellLabelAutoDelete])->(RefLink[True, paclet:ref/True]). If (RefLink[CellLabelAutoDelete, paclet:ref/CellLabelAutoDelete])->(RefLink[Automatic, paclet:ref/Automatic]), then they are only automatically deleted if the cell is modified.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Select the cell being evaluated and get its (RefLink[CellLabel, paclet:ref/CellLabel]) setting:

SelectionMove[EvaluationNotebook[],All,EvaluationCell];Options[NotebookSelection[EvaluationNotebook[]],CellLabel]

Attach a label to a text cell:

CellPrint[TextCell["abcde","Text",CellLabel->"Example",CellMargins->{{120,24},{6,6}}]]

abcde

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CellTags, paclet:ref/CellTags])  ▪  (RefLink[CellLabelAutoDelete, paclet:ref/CellLabelAutoDelete])  ▪  (RefLink[ShowCellLabel, paclet:ref/ShowCellLabel])  ▪  (RefLink[CellLabelStyle, paclet:ref/CellLabelStyle])  ▪  (RefLink[$Line, paclet:ref/$Line])  ▪  (RefLink[In, paclet:ref/In])  ▪  (RefLink[Out, paclet:ref/Out])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Notebooks from the Kernel, paclet:tutorial/ManipulatingNotebooksFromTheKernel])}, {▪(RefLinkPlain[Options for Cells, paclet:tutorial/OptionsForCells])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Cell Styling Options, paclet:guide/CellStylingOptions])}, {▪(RefLinkPlain[Wolfram System Session History, paclet:guide/WolframSystemSessionHistory])}})}})