Re: "Counter" in macro



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)

.


Loading