1
$\begingroup$

There is option to evaluate the complete notebook but I wanted to know if its possible to evaluate notebook from some desired cell to end or some other desired cell following?

$\endgroup$
4
  • 1
    $\begingroup$ You could always left click the cell where you want to start, scroll down to the bottom and press shift while left clicking the last cell and then right click on any of the selected cells and choose "evaluate cells" $\endgroup$
    – C. E.
    Commented May 31, 2013 at 18:07
  • 1
    $\begingroup$ Set the cells initialization or cell tags. $\endgroup$ Commented Jun 1, 2013 at 1:25
  • 1
    $\begingroup$ I regularly do Ctrl+A and then Ctrl+click to deselect different cells. $\endgroup$
    – William
    Commented Jun 1, 2013 at 7:18
  • $\begingroup$ I have a feeling there is a similar question on this site long time ago, but I can't find it.. $\endgroup$
    – Silvia
    Commented Jun 2, 2013 at 7:25

1 Answer 1

6
$\begingroup$

Does this work as you wish?

CreatePalette@Button["Evaluate down", 
  With[{nb = InputNotebook[]},
   SelectionMove[nb, Previous, Cell];
   With[{prevCell = SelectedCells[nb] /. {c_} :> c},
    Function[cell,
      SelectionMove[cell, All, Cell];
      SelectionEvaluateCreateCell@nb
      ]~Scan~
     Intersection[
      Reverse@TakeWhile[Reverse@Cells[nb], # =!= prevCell &], 
      Cells[nb, CellStyle -> "Input"]]]
   ]
  ]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.