![]() |
|
#1
|
|||
|
|||
![]()
Hi guys i hope this is an easy question to answer because im kinda stumped. Im looking to have an array that will fill out a table after a user selects an option the problem is i dont know how to specify the table to input the data. any help would be greatly appreciated
|
#2
|
||||
|
||||
![]()
Simple:
Code:
With ActiveDocument.Tables(#) 'updating code goes here End with
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Just to emphasis a point; the index number of the table collection is the ORDER in the document. A table does not have an explicit index number. Or rather, it does have an explicit number, but the number is derived dynamically from the order the table is in. So if Tables(4) has a table inserted before it, it is now Tables(5). And if Tables(4) is moved after Tables (7), it now becomes Tables(7) - as Tables(7) becomes Tables(6), because Tables(4) is no longer there.
|
#4
|
|||
|
|||
![]()
Or (and I prefer this), if your tables are bookmarked you can point to a table by name, and it does not matter where they are in the document; nor does it matter if other tables are inserted; nor does it matter if they are ever moved. The index number is not needed, nor used.
|
#5
|
||||
|
||||
![]() Quote:
Code:
With ActiveDocument.Bookmarks("MyBookmark").Range.Tables(1) 'updating code goes here End with
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
SuzeG | Word VBA | 8 | 01-02-2014 08:05 AM |
Adding a border to every nth row of a word table | hummus_it | Word VBA | 4 | 10-04-2013 03:59 PM |
![]() |
tinfanide | Excel Programming | 4 | 12-26-2012 08:56 PM |
![]() |
hklein | Word VBA | 2 | 07-25-2011 01:45 AM |
![]() |
hannu | Excel | 1 | 09-18-2010 01:15 AM |