blueskygerma.blogg.se

How do i number rows in a word table
How do i number rows in a word table







how do i number rows in a word table

When we insert a SECOND table, MS Word automatically titles it “Table 1-b” since it is within the same section: MS Word automatically changes the title to “Table 1-a” which is what we want: Select the “Include chapter number” check-box and then select “Heading 1” from the “Chapter starts with style” drop-down list. As you can see, by default, Word is ready to assign the “Table 1” title to your table but that’s not what we want:Ĭlick the Numbering button to display the Caption Numbering dialog box (above). Then click Insert Caption button on the References tab to display the Caption dialog box. This command jumps to the beginning of the next table, and you can then paste the header row you copied earlier.You would like to insert TABLES to this text but number them starting with the multilevel number of the section they are in.įor example, you want the tables placed in section number “2” as “Table 2-a”, “Table 2-b”, “Table 2-c” and not simply as “Table 1”, “Table 2”, “Table 3”, etc.

how do i number rows in a word table

Selection.GoTo What:=wdGoToTable, Which:=wdGoToNext Then, you can move the insertion point to the beginning of the next table (the newly created one) by using the following command:

how do i number rows in a word table

This command splits the table at row 5 you can easily change the splitting point by changing the row at which it is split. You could copy the first row of the table and then split the table using a command similar to the following: There is another way to programmatically handle the underlying action that Mary wants to achieve, however-a method that doesn't require the use of index numbers for the Tables collection. The macro can be easily adapted to a larger context, such as one where the table is split and otherwise manipulated. To use the macro, simply make sure that the insertion point is within the desired table. MsgBox "The current table is table " & iTableNum If ("TempBM") ThenĪctiveDocument.Bookmarks("TempBM").SelectĪctiveDocument.Bookmarks("TempBM").Delete The following macro implements these steps: Once you find that out, you know which table is the current one, and you can delete the bookmark. The simplest way is to add a bookmark to the current table, and then examine all the tables in the document to see which table contains that bookmark. For instance, you could use the following to discover how many tables are in a document, as it returns the number of objects in the Tables collection:įinding which table is the current one is a bit trickier, but it can be done. You can easily find the number of objects in a collection using the Count property. This goes not only for tables, but for paragraphs, graphics, and a host of other objects. Word's object model relies on organizing individual objects into collections that can be accessed programmatically. Mary wants to know how she can discover the index number for the active table (before the split) so she can simply increment that number to know the new index number for the table created after the split. In order to do this properly, she wants to determine the index numbers used by Word to reference the two tables in the Tables collection. Working on the active table isn't much of a problem, but she wants to copy the first row of the active table, then split the table, and finally paste the copied row to the first row of the new table created by the split. Mary is writing a macro that will split a table.









How do i number rows in a word table