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 have a very big notebook with a command repeated a lot of times but with different parameters each time and I want to run all these commands at the same time without having to run separately all of them. Is there a way?

EDIT: more info

Between different calls of the 'command' there are other things (mainly plots) and I want to preserve the order of the notebook.

Using the Evaluate Notebook form the menu Evaluation can be an option but when I am in a hurry this is bad because it evaluates also all the things in between while I am mainly interested in the output of my commands.

share|improve this question
Any reason not to just merge the cells into one, or better yet, change the 'command' to accept arguments and then map/table over the different parameters? – ciao Jan 21 '14 at 12:26
@rasher between different calls of my 'command' there are things and I want to preserve this ordering for formatting reasons – Red Jan 21 '14 at 12:29
Ah, ok then, what about the Evaluate Notebook menu item? NVM - I missed the 'same name' part... – ciao Jan 21 '14 at 12:34
@rasher I added more info in the question – Red Jan 21 '14 at 12:41
You could mark the cells you don't want evaluated as such in the cell menu (you can collectively do this). Otherwise, probably some notebook programming involved. – ciao Jan 21 '14 at 12:43
up vote 1 down vote accepted

As requested:

Use tags on the cells you want (same tag for all), then NotebookLocate andSelectionEvaluate together.

share|improve this answer

I get it using this code:

nb = EvaluationNotebook[];
NotebookEvaluate[nb, InsertResults -> True, EvaluationElements -> {"Tags" -> {"evaluate"}}];

and tagging with the tag evaluate only the cells that I want to evaluate on first run.

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.