View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Help me with a formula in Table

Hi BigOz,

On re-reading your post, I believe you'd need a macro to do the count in Word. For example:

Sub GenderCount()
Dim F As Integer
Dim M As Integer
Dim i As Integer
Dim CelTxt As Range
F = 0
M = 0
With Selection
If .Information(wdWithInTable) = True Then
With .Range.Tables(1)
If .Rows.Count 27 Then
MsgBox "Only " & .Rows.Count & " rows in selected table!", vbCritical
Exit Sub
End If
If .Columns.Count 6 Then
MsgBox "Only " & .Columns.Count & " columns in selected table!", vbCritical
Exit Sub
End If
For i = 2 To 27
Set CelTxt = .Cell(i, 6).Range
CelTxt.End = CelTxt.End - 1
If CelTxt.Text = "F" Then F = F + 1
If CelTxt.Text = "M" Then M = M + 1
Next
MsgBox "Count of 'F' entries: " & F & vbCrLf & "Count of 'M' entries: " & M
End With
Else
MsgBox "No table selected!", vbCritical
End If
End With
End Sub

--
Cheers
macropod
[MVP - Microsoft Word]


"BigOz" wrote in message ...
I want a count.

in column F2:F27, how many "F" (or "M") are there in the column
--
Sua Sponte