strings in a range

P

Peter Morris

what's a function I can use in VB to count the
number of times a particular string occurs in
a named range of cells?
 
B

Bob Phillips

Application.Countif(Range("myRange"),"string")

as an example

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
P

Peter Morris

Bob Phillips said:
Application.Countif(Range("myRange"),"string")

as an example

That works.

also, is it possible to use wildcards in the search string?

Or to count the number of cells in the range with ANY
text in?
 
T

Tom Ogilvy

Application.Countif(Range("myRange"),"*string*)

Application.CountA(range("MyRange"))
 
Top