worksheet functions

G

Gmet

I am trying to run a worksheet function.
MyPik="Bob"
MyNameCount = Application.WorksheetFunction = "=countif
(A2:A100,MyPik)"
I get an error. If I use the literal "Bob" I get an
error.

What have done wrong?

Gmet
 
F

Frank Kabel

Hi
try:
MyNameCount =
Application.WorksheetFunction.countif(range("A2:A100"),MyPik)
 
Top