I have checked, and while it is not in Macros9, it is in Macros8.
However, here is the code:
Sub TableCellHelper()
'************************************
'* Declarations *
'* Section *
'************************************
Dim TC%, TR%, FC%, LC%, FR%, LR%, dummy%, Row%, Col%
Dim FTC&, LCT&
Dim Q1Dbl$, Q2Dbl$
Dim Msg1$, Msg2$, Msg3$, Msg4$, Msg5$, Msg6$, Title$
'************************************
'* Initialization *
'* Section *
'************************************
Msg3$ = "Your selection must be entirely within a single table."
Msg6$ = "Word cannot display the total columns and or rows because some
cells are either split or merged."
Title$ = "Table Cell Helper"
If Application.Documents.Count Then
If Selection.Information(wdWithInTable) Then
Col = Selection.Information(wdMaximumNumberOfColumns)
Row = Selection.Information(wdMaximumNumberOfRows)
FC = Selection.Information(wdStartOfRangeColumnNumber)
LC = Selection.Information(wdEndOfRangeColumnNumber)
FR = Selection.Information(wdStartOfRangeRowNumber)
LR = Selection.Information(wdEndOfRangeRowNumber)
FCT = FC / 26
Select Case FCT
Case 0 To 1
Q1Dbl = ""
Case Is <= 2
Q1Dbl = "A"
FC = FC - 26
Case Else
Q1Dbl = "B"
FC = FC - 52
End Select
LCT = LC / 26
Select Case LCT
Case 0 To 1
Q2Dbl = ""
Case Is <= 2
Q2Dbl = "A"
LC = LC - 26
Case Else
Q2Dbl = "B"
LC = LC - 52
End Select
Msg1$ = "At cell " & Q1Dbl & Chr$(Val(FC) + 64) & ":" & LR & "."
Msg2$ = "Selected cell range is " & Q1Dbl & Chr$(Val(FC) + 64) & FR
& ":" & Q2Dbl & Chr$(Val(LC) + 64) & LR & "."
Msg5$ = "There are a total of " & Col & " columns, and " & Row & "
rows in this table."
If FC = LC And FR = LR Then
dummy = MsgBox(Msg1$ & " " & Msg5$, vbOKOnly, Title$)
Else
dummy = MsgBox(Msg2$ & " " & Msg5$, vbOKOnly, Title$)
End If
Else
dummy = MsgBox(Msg3$, vbOKOnly, Title$)
End If
On Error GoTo TError
End If
Exit Sub
TError:
If Err = 5992 Then
dummy = MsgBox(Msg6$, vbOKOnly, Title$)
End If
Resume Next
End Sub
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP