Skip to content

Instantly share code, notes, and snippets.

@ricdeez
Created September 20, 2015 21:02
Show Gist options
  • Save ricdeez/fe800ca5a5e9fe123879 to your computer and use it in GitHub Desktop.
Save ricdeez/fe800ca5a5e9fe123879 to your computer and use it in GitHub Desktop.
Adds IDs to MS Word Table in Selection
Public Sub test()
Dim tbl As Word.Table
Dim c As Long
Dim n As Long
Set tbl = Word.Selection.Tables(1)
c = 0
For n = 1 To tbl.Rows.Count
If n > 1 Then
c = c + 1
tbl.Cell(n, 1).Range.Text = CStr(c) & "."
End If
Next n
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment