Sub Macro1()
Dim i As Integer
For i = 1 To ActiveDocument.Tables.Count
If Selection.InRange(ActiveDocument.Tables(i).Range) Then Exit For
Next
MsgBox IIf(i > ActiveDocument.Tables.Count, "No tables are selected!", "tables(" & i & ") is selected!")
End Sub
Sub Macro1()
Dim i As Integer
For i = 1 To ActiveDocument.Tables.Count
If Selection.InRange(ActiveDocument.Tables(i).Range) Then Exit For
Next
MsgBox IIf(i > ActiveDocument.Tables.Count, "No tables are selected!", "tables(" & i & ") is selected!")
End Sub