SHARE
TWEET

Untitled

a guest Aug 9th, 2013 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CellsByTag[notebook_, tag_] := Module[{cells},
  2.   cells[nb_NotebookObject] := cells[nb, _];
  3.   cells[nb_NotebookObject, pat_] :=
  4.    Flatten@cells[First@NotebookGet[nb], pat];
  5.   cells[cellList_List, pat_] := cells[#, pat] & /@ cellList;
  6.   cells[Cell[CellGroupData[group_List, ___]], pat_] :=
  7.    cells[#, pat] & /@ group;
  8.   cells[c_Cell, pat_] := If[MatchQ[c, pat], c, {}];
  9.   cells[__] := {};
  10.   cells[notebook, _?(MemberQ[Flatten[{CellTags} /. Options[#]],
  11.        tag] &)]
  12.   ]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top