View Single Post
 
Old 08-17-2015, 08:57 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote