# Correct way to make groups of cells (not) evaluable

Let us say that I want to make all the cells within a section not evaluable. In principle, I would simply highlight the relevant section, then go to Cell -> Cell properties and untick the Evaluable. However, the problem is that if for some reason, I wish to make the section evaluable again, I would go back and tick the Evaluable box again. This, however, causes the section title and all the Texts within the section to also be evaluated, which of course is not what I want. When I toggle back the Evaluable, I would like it to do so only for the Input Cells of course. Is there to achieve this?

• Is it satisfactory to enclose everything which you're not interested in evaluating in in a comment? Simply highlight everything you don't need to run and then either Edit -> Un/Comment section or just put comments over something you don't want? – Brad Mar 12 '19 at 20:59

The key is to re-enable it with CurrentValue[_CellObject, Evaluatable] = Inherited. You can create a custom palette:

CreatePalette @ Column[
Button[
StringForm["Evaluatable -> ", #],
CurrentValue[SelectedCells@InputNotebook[], Evaluatable] = #
] & /@ {False, Inherited}
]


Or you can use notebook actions analogously to https://mathematica.stackexchange.com/a/184568/5478

• CurrentValue can be used to set all cells at once, so: CurrentValue[SelectedCells @ InputNotebook[], Evaluatable] = False is simpler. – Carl Woll Mar 17 '19 at 23:05
• @CarlWoll right, thanks, I forgot about that feature. – Kuba Mar 18 '19 at 9:59