![]() |
|
|
|
#1
|
|||
|
|||
|
No harm, no foul. My point is that you didn't indicate from the start that your cell content could contain text that was invalid for a bookmark name, that it could be two or more words separated by spaces or that your really only wanted the first word.
If you really only want the first word then both mine and Paul's code could have been different: Code:
Sub Demo()
Dim lngIndex As Long
Dim oTbl As Table
For lngIndex = 2 To ActiveDocument.Tables.Count
Set oTbl = ActiveDocument.Tables(lngIndex)
With oTbl
.Range.Bookmarks.Add Trim(.Cell(1, 1).Range.Words(1)), .Range
End With
Next lngIndex
End Sub
Last edited by gmaxey; 05-15-2019 at 12:09 PM. |
|
| Tags |
| bookmark, table |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use of named ranges based on cell content | Intruder | Excel | 12 | 02-25-2019 09:42 AM |
| save selected worksheets, named by cell value | rossmortimore | Excel | 1 | 12-27-2018 01:56 PM |
Code to find a named (bookmarked?) table, replicate a row or table, and delete a specified table.
|
kevinbradley57 | Word VBA | 9 | 09-21-2017 04:58 PM |
how do i use a named cell for each worksheet
|
cwkotch | Excel | 3 | 11-03-2015 09:04 AM |
| Can't use a zero in a named cell | TechEd | Excel | 2 | 10-16-2012 10:06 PM |