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

This question already has an answer here:

I was wondering if I can toggle the "CellOpen" state from a cell (or bunch of cells) from another cell. i.e. I am imagining having a manipulate command along the lines of:

Manipulate[If[show, "set the status of these cells to open", 
"set the status of these cells to closed"],
{{show, True, "Show cells"}, {True, False}}]

where for example "all these cells" could be all Output cells, or a subset of those as defined by some list.


share|improve this question

marked as duplicate by Jacob Akkerboom, m_goldberg, R. M. Jan 8 '14 at 18:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Yes! You can find a Cell that has tag "tag" using Cells[nb, CellTags->"tag"]. Then you can set the option you want using SetOptions. I made some code that generates a notebook, so that it is clear which things should be in different cells. In the generated notebook, the master cell can change the background of the slave cell. Try to put another value than LightGreen.

nb =
         Cells[CellTags -> "Slave"] // First, {GeneratedCell -> False,
           Background -> LightGreen}]]]
      CellTags -> "Master"


     Cell[BoxData[MakeBoxes[Print["I am not evaluated :("]]]
      CellTags -> "Slave"


NotebookEvaluate[nb, EvaluationElements -> {"Tags" -> {"Master"}}, 
 InsertResults -> True]
share|improve this answer
That's great. Thanks. – tbtom Jan 8 '14 at 15:58

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