Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
BigOz BigOz is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.tables
Jean-Guy Marcil[_2_] Jean-Guy Marcil[_2_] is offline
external usenet poster
 
Posts: 373
Default 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   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,

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   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

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table formula? Miss Jenny Microsoft Word Help 3 June 7th 08 04:07 AM
Table Formula Frank Tables 3 February 22nd 08 11:14 PM
how to use a formula in a table to allow a # in a record to be mer Jennifer Mcdermeit Mailmerge 1 July 18th 06 07:31 PM
Table Formula Help Stefani Tables 2 April 12th 05 04:23 PM
formula in a table JustMe Microsoft Word Help 2 February 8th 05 06:19 AM


All times are GMT +1. The time now is 01:38 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"