You don't really need a macro for this. Apply the List Number style to the headings. If your document is typical the following will do it.
Code:
Sub AddNumStyle()
Dim oPara As Range
Dim oTable As Table
For Each oTable In ActiveDocument.Tables
Set oPara = oTable.Range
oPara.Collapse 1
oPara.Start = oPara.Start - 2
oPara.Collapse 1
oPara.End = oPara.Paragraphs(1).Range.End
oPara.Style = "List Number"
Next oTable
End Sub