Help with excel formula

Closed
sk - Oct 1, 2009 at 12:47 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 1, 2009 at 09:22 PM
Hello,

I have to count the number of times the word "work" appears in column A. Column A is a full sentence column with the word "work" appearing only once in the sentence. Also, I just want to count the word when the acronym TPI appears in column F. Any help is greatly appreciated.

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 1, 2009 at 09:22 PM
try this macro (modify to suit you)

Sub test()
Dim j As Integer, r As Range, c As Range
Worksheets("sheet1").Activate
Set r = Range(Range("A1"), Range("A1").End(xlDown))
j = 0
For Each c In r
If InStr(1, c, "work", 1) > 0 Then j = j + 1
Next c
MsgBox "the number of times the word work appears is " & " " & j
End Sub
0