![]() |
|
#2
|
||||
|
||||
|
How about
Code:
Sub NumberTable()
Dim oRow As Row
Dim oRng As Range
Dim lCount As Long
Dim wCount As Long
Dim i As Long
lCount = 1
wCount = 1
With ActiveDocument.Range.Tables(1)
For i = 1 To .Rows.Count
Set oRow = .Rows(i)
If i Mod 2 = 0 Then
Set oRng = oRow.Cells(1).Range
oRng.End = oRng.End - 1
oRng.Text = "L" & Format(lCount, "000")
lCount = lCount + 1
Else
Set oRng = oRow.Cells(1).Range
oRng.End = oRng.End - 1
oRng.Text = "W" & Format(lCount, "000")
wCount = wCount + 1
End If
Next i
End With
lbl_Exit:
Set oRow = Nothing
Set oRng = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to create a table with a number of line depending a number entered by user
|
Cellendhyll | Word Tables | 3 | 07-10-2014 05:49 AM |
How Can I Use a Page Number in a Table Header Row
|
jqavins | Word | 8 | 01-10-2014 08:43 AM |
Page number in table of Content
|
Ritu | Office | 1 | 09-19-2011 05:10 AM |
| Different Table Number System | Nebabon | Word | 0 | 08-30-2010 10:23 AM |
| Different Table Number System | Nebabon | Word Tables | 0 | 08-27-2010 03:16 PM |