Create bookmarks in the only table of the active document using VBA
Posted on 2014-01-11
I got a 2 column table in the currently active document. The number of rows can vary from
1 to n rows depending on the currently active document.
I would like to run a macro that ...
... creates bookmarks of the cell values in the second column of the only table in the currently active document.
... The macro is to run thru the table from top to bottom. The bookmarks are to be named:
Example sample table
Column 1 Column 2
17 Surgery Department
13 Oncology Department
18 Pediatrics Department
So the following bookmarks should be created
bookmark_01 = Range of Text marked by the bookmark: Surgery Department
bookmark_02 = Range of Text marked by the bookmark: Oncology Department
bookmark_03 = Range of Text marked by the bookmark: Pediatrics Department
The range of text marked by the bookmark is not to include the cell end marker
Help is much appreciated, thank you very much in advance.