Re: Occurances of value

From: Todd Huttenstine (t.huttenstine_at_charter.net)
Date: 08/15/04


Date: Sun, 15 Aug 2004 00:48:06 -0400

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" <Trevor@Shucks.demon.co.uk> wrote in message
news:OLjPr%23jgEHA.3016@tk2msftngp13.phx.gbl...
> 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" <anonymous@discussions.microsoft.com> wrote in message
> news:64e401c4823c$b4671680$a401280a@phx.gbl...
> > 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
>
>