Sub 自動填滿序欄位() '有合併儲存格的情形下'2016/1/5
On Error GoTo eH
Dim clm As Column
Dim r As Long, c As Cell
Set clm = ThisDocument.Tables(1).Columns(1)
r = clm.Cells.Count
For i = 2 To r
clm.Cells(i).Range = i - 1
Next
MsgBox "DONE!!", vbInformation
Exit Sub
eH:
Select Case Err.Number
Case 13 ' 型態不符合
Resume Next
Case Else
Debug.Print Err.Number & Err.Description
MsgBox Err.Number & Err.Description, vbCritical
' Stop
' Resume
End Select
End Sub