Re: "Counter" in macro
- From: "Ron de Bruin" <rondebruin@xxxxxxxxxxxx>
- Date: Mon, 15 Sep 2008 20:20:40 +0200
See my reply Mike
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"Mike H" <MikeH@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:746B6D60-C26A-4F79-9BEE-D578664D573D@xxxxxxxxxxxxxxxx
Hi,.
I'd prefer
Count = WorksheetFunction.CountIf(Range("A1:D200"), "Boo")
no need for application
I did it that way because I wanted to include Ucase(trim....
What's the syntax for including that in work***.function method?
Mike
"Rick Rothstein" wrote:
> But if you have a particular reson for wanting a macro then use this
> > Sub marine()
> Dim Myrange As Range
> Set Myrange = Range("A1:D200")
> For Each c In Myrange
> If UCase(Trim(c.Value)) = "BOO" Then
> Count = Count + 1
> End If
> Next
> MsgBox Count
> End Sub
Or...
Sub marine() ' <g>
Dim Count As Long
Count = Application.WorksheetFunction.CountIf(Range("A1:D200"), "Boo")
MsgBox Count
End Sub
--
Rick (MVP - Excel)
- References:
- "Counter" in macro
- From: bobkap
- RE: "Counter" in macro
- From: Mike H
- Re: "Counter" in macro
- From: Rick Rothstein
- Re: "Counter" in macro
- From: Mike H
- "Counter" in macro
- Prev by Date: Re: Chart with a defined named range?
- Next by Date: Re: "Counter" in macro
- Previous by thread: Re: "Counter" in macro
- Next by thread: click LINK
- Index(es):