Macro with count if

O

orquidea

Hi:

I want to create a macro that counts the rows wich have -P in any part of
the word. I will create 2 variables PU= total of rows with -P and IN=total
of rows without -P.

A
CCNG-PU
CNDLF
DLKJFOE
CNFIE-PU
3540-PU
DLREI

Could anyone help me with it please.

Thanks in advance

Orquidea
 
B

Bob Phillips

PU=Activesheet.Evaluate("SUMPRODUCT(--(ISNUMBER(SEARCH("-P",A2:A200))))")

IN = Application.COUNTA(A:A) - PU

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
O

orquidea

Hi Bob

Thanks for your help. I was trying the subprocedure but a "syntax error"
pops up in the first line, it highlights this part.("-P",A2:A200))))")

Could you please help to make it work?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top