SelectionEvaluateCreateCell[notebook]
takes the current selection in a notebook and creates a new cell containing the result obtained by evaluating the contents of the selection using the kernel.
SelectionEvaluateCreateCell[notebook,sel]
sets the current selection after the evaluation to be as specified by sel.
SelectionEvaluateCreateCell
SelectionEvaluateCreateCell[notebook]
takes the current selection in a notebook and creates a new cell containing the result obtained by evaluating the contents of the selection using the kernel.
SelectionEvaluateCreateCell[notebook,sel]
sets the current selection after the evaluation to be as specified by sel.
Details
- The first argument of SelectionEvaluateCreateCell is a NotebookObject.
- Possible settings for sel are as in NotebookWrite.
- The default for sel is After.
- SelectionEvaluateCreateCell[notebook,All] sets the current selection to be the cell corresponding to the result from the evaluation.
- SelectionEvaluateCreateCell performs the same underlying operation as typing
in the front end. It does not, however, have side effects such as incrementing $Line.
Examples
open all close allBasic Examples (1)
Scope (2)
Make the selection be a point within an input cell:
nb = NotebookPut[Notebook[{Cell[BoxData[RowBox[{"17", "^", "4"}]], "Input"]}]];SelectionMove[nb, Before, CellContents];SelectionEvaluateCreateCell takes the whole cell as input:
SelectionEvaluateCreateCell[nb]nb = NotebookPut[Notebook[{Cell[BoxData[RowBox[{"17", "^", "3"}]], "Input"], Cell["text", "Text"], Cell[BoxData[RowBox[{"17", "^", "4"}]], "Input"]}]];SelectionMove[nb, All, Notebook]Evaluate all the evaluatable cells in the selection:
SelectionEvaluateCreateCell[nb]Properties & Relations (1)
SelectionEvaluate evaluates the selected expression in place:
nb = NotebookPut[Notebook[{Cell[BoxData[RowBox[{"17", "^", "4"}]], "Input"]}]];SelectionMove[nb, All, CellContents]SelectionEvaluate[nb]Tech Notes
Related Workflows
- Apply a Function to Cells in a Notebook ▪
- Run a Notebook Programmatically ▪
- Create a Palette
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), SelectionEvaluateCreateCell, Wolfram Language function, https://reference.wolfram.com/language/ref/SelectionEvaluateCreateCell.html.
CMS
Wolfram Language. 1996. "SelectionEvaluateCreateCell." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SelectionEvaluateCreateCell.html.
APA
Wolfram Language. (1996). SelectionEvaluateCreateCell. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SelectionEvaluateCreateCell.html
BibTeX
@misc{reference.wolfram_2026_selectionevaluatecreatecell, author="Wolfram Research", title="{SelectionEvaluateCreateCell}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/SelectionEvaluateCreateCell.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_selectionevaluatecreatecell, organization={Wolfram Research}, title={SelectionEvaluateCreateCell}, year={1996}, url={https://reference.wolfram.com/language/ref/SelectionEvaluateCreateCell.html}, note=[Accessed: 13-June-2026]}