Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey guys
I have values in range K40:K90. The variable called FndVal = "dog". Using the find function, how do I determine the number of occurances "dog" is found within this range? Todd |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Todd
one suggestion: Sub test() ' the best function would be: =COUNTIF(K40:K90,"dog") Dim FndVal As String Dim DogCount As String FndVal = "dog" MsgBox WorksheetFunction.CountIf(Range("K40:K90"), FndVal) ' or MsgBox WorksheetFunction.CountIf(Range("K40:K90"), "dog") End Sub Regards Trevor "Todd Huttenstine" wrote in message ... Hey guys I have values in range K40:K90. The variable called FndVal = "dog". Using the find function, how do I determine the number of occurances "dog" is found within this range? Todd |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
I do not believe I have ever had the need to use the countif function before in code, and I dont recall ever using it in a spreadhseet as a function either. I knew it seemed like an easy task. Thanks for your help. Todd "Trevor Shuttleworth" wrote in message ... Todd one suggestion: Sub test() ' the best function would be: =COUNTIF(K40:K90,"dog") Dim FndVal As String Dim DogCount As String FndVal = "dog" MsgBox WorksheetFunction.CountIf(Range("K40:K90"), FndVal) ' or MsgBox WorksheetFunction.CountIf(Range("K40:K90"), "dog") End Sub Regards Trevor "Todd Huttenstine" wrote in message ... Hey guys I have values in range K40:K90. The variable called FndVal = "dog". Using the find function, how do I determine the number of occurances "dog" is found within this range? Todd |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're welcome. Hope it has given you the answer you needed.
Regards Trevor "Todd Huttenstine" wrote in message ... Thanks I do not believe I have ever had the need to use the countif function before in code, and I dont recall ever using it in a spreadhseet as a function either. I knew it seemed like an easy task. Thanks for your help. Todd "Trevor Shuttleworth" wrote in message ... Todd one suggestion: Sub test() ' the best function would be: =COUNTIF(K40:K90,"dog") Dim FndVal As String Dim DogCount As String FndVal = "dog" MsgBox WorksheetFunction.CountIf(Range("K40:K90"), FndVal) ' or MsgBox WorksheetFunction.CountIf(Range("K40:K90"), "dog") End Sub Regards Trevor "Todd Huttenstine" wrote in message ... Hey guys I have values in range K40:K90. The variable called FndVal = "dog". Using the find function, how do I determine the number of occurances "dog" is found within this range? Todd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count Occurances | Excel Discussion (Misc queries) | |||
Count occurances | Excel Worksheet Functions | |||
Count of different occurances | Excel Discussion (Misc queries) | |||
Counting 7 and 8 occurances | Excel Discussion (Misc queries) | |||
Counting Occurances | Excel Discussion (Misc queries) |