Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Help me with a formula in Table
I want a count.
in column F2:F27, how many "F" (or "M") are there in the column -- Sua Sponte |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
Help me with a formula in Table
"BigOz" wrote:
I want a count. in column F2:F27, how many "F" (or "M") are there in the column Can you embed an Excel table instead? It would be so much easier in Excel! |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
Help me with a formula in Table
Hi BigOz,
You can find the cell address for a given cell by running the following macro. The cell address is displayed on the status bar. Sub CellAddress() If Selection.Information(wdWithInTable) = True Then If Selection.Cells(1).ColumnIndex 26 Then StatusBar = "Cell Address: " & Chr(64 + Int(Selection.Cells(1).ColumnIndex / 26)) & _ Chr(64 + (Selection.Cells(1).ColumnIndex Mod 26)) & Selection.Cells(1).RowIndex Else StatusBar = "Cell Address: " & Chr(64 + Selection.Cells(1).ColumnIndex) & _ Selection.Cells(1).RowIndex End If End If 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 |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Table formula? | Microsoft Word Help | |||
Table Formula | Tables | |||
how to use a formula in a table to allow a # in a record to be mer | Mailmerge | |||
Table Formula Help | Tables | |||
formula in a table | Microsoft Word Help |