Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Simple way to number the rows in a table?
I have a document containing descriptions of parts. Each part section
contains a tables with a row for each sub-part. There are hundreds of parts and each part has up to 10-15 sub-part. I would like to number the rows in each table to use as automatically-generated sub-part numbers. I found several articles on the Internet that suggest using a numbered list. One example is: http://blogs.techrepublic.com.com/msoffice/?p=487 The problem with that approach is I have to manually restart the numbering in each table, such as if I copy a table (as a template) for a new table. Another problem it the tab character that Word inserts after the list number. Is there a way to get each table to automatically restart numebring at "1" (after the header row) and replace the tab character with a single space? If not, is there another way? |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Simple way to number the rows in a table?
Run a macro containing the following code:
Dim i As Long Dim atable As Table For Each atable In ActiveDocument.Tables With atable For i = 1 To .Rows.Count .Cell(i, 1).Range.Text = i Next i End With Next atable If you want the numbering to start in the second row of each table, use Dim i As Long Dim atable As Table For Each atable In ActiveDocument.Tables With atable For i = 2 To .Rows.Count .Cell(i, 1).Range.Text = i - 1 Next i End With Next atable -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Sesquipedalian Sam" wrote in message ... I have a document containing descriptions of parts. Each part section contains a tables with a row for each sub-part. There are hundreds of parts and each part has up to 10-15 sub-part. I would like to number the rows in each table to use as automatically-generated sub-part numbers. I found several articles on the Internet that suggest using a numbered list. One example is: http://blogs.techrepublic.com.com/msoffice/?p=487 The problem with that approach is I have to manually restart the numbering in each table, such as if I copy a table (as a template) for a new table. Another problem it the tab character that Word inserts after the list number. Is there a way to get each table to automatically restart numebring at "1" (after the header row) and replace the tab character with a single space? If not, is there another way? |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Simple way to number the rows in a table?
On Sat, 25 Jul 2009 16:28:45 +1000, "Doug Robbins - Word MVP"
wrote: Run a macro containing the following code: Dim i As Long Dim atable As Table For Each atable In ActiveDocument.Tables With atable For i = 1 To .Rows.Count .Cell(i, 1).Range.Text = i Next i End With Next atable If you want the numbering to start in the second row of each table, use Dim i As Long Dim atable As Table For Each atable In ActiveDocument.Tables With atable For i = 2 To .Rows.Count .Cell(i, 1).Range.Text = i - 1 Next i End With Next atable Thank you. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reverse table order/number rows | Tables | |||
Arbitrary number of rows in a table | Mailmerge | |||
how can I count the number of rows in an existing table | Tables | |||
Count number of rows in table | Microsoft Word Help | |||
Limiting number of table rows per page | Tables |