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

Is there a way to programmatically detect whether or not NotebookLocate[{"file", "cell tag"}] has found the cell? And then if not found, stay at current selection instead of jumping to the end of the notebook?

share|improve this question
up vote 4 down vote accepted

my solution (but I have limited skill) would be to first check if the tag you were looking for was in the list of the notebook's cell tags...


If not, then don't bother looking in the first place...?

So create your own "notebook locate" that checks if the tag in question is a member of the cell tag list, and if so, then call NotebookLocate

share|improve this answer
I think it's worth adding that NotebookTools is an undocumented package. This answer confused me for a bit, until I figured that out. – ibeatty Jul 12 '15 at 19:37

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.