Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that I can select individual evaluatable cells and disable their Open property (through Cell > Cell Properties), but is there a simple way to toggle the Open status of all evaluatable cells?

share|improve this question
This, this and this may be helpful. – bobthechemist Jul 25 '13 at 22:44
up vote 4 down vote accepted

Something like this? (V9 and after only, because of Cells.)

toggleCellOpen[nb_: SelectedNotebook[]] :=
 (CurrentValue[#, CellOpen] = Not@CurrentValue[#, CellOpen]) & /@ 
   Select[Cells[], CurrentValue[#, Evaluatable] &]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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