Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Occurances of value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Occurances of value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Occurances of value

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Occurances of value

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Occurances gjameson via OfficeKB.com Excel Discussion (Misc queries) 3 January 4th 10 07:09 PM
Count occurances Gaurav[_2_] Excel Worksheet Functions 1 April 26th 08 01:11 AM
Count of different occurances Bee Excel Discussion (Misc queries) 3 October 8th 07 03:36 AM
Counting 7 and 8 occurances [email protected] Excel Discussion (Misc queries) 2 May 9th 07 02:59 AM
Counting Occurances Rusty Excel Discussion (Misc queries) 5 July 10th 06 08:29 PM


All times are GMT +1. The time now is 04:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"