What is the formular that will count IF a specific word is found,.

J

JakeW

What is the formular that will count IF a specific word is found in a word
table column, such as 'YES'?
 
G

Greg

Jake,

Maybe you could use a macro something like:

Dim oTable As Table
Dim oRng As Range
Dim oCell As Cell
Dim pContent As String
Dim i As Integer
Dim rowLast As Long


Set oTable = ActiveDocument.Tables(1)
rowLast = oTable.Rows.Count
i = 0
Set oRng = oTable.Range
For Each oCell In oRng.Columns(1).Cells
pContent = oCell.Range.Text
pContent = Left(pContent, Len(pContent) - 2)
If pContent = "Yes" Then
i = i + 1
End If
Next
ActiveDocument.Tables(1).Cell(rowLast, 1).Range.Text = i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top