#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Macro with count if


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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Macro with count if

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)

"orquidea" wrote in message
...

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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default Macro with count if

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.


"Bob Phillips" wrote:

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)

"orquidea" wrote in message
...

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help to count by macro or whatever simple and easy.... driller Excel Discussion (Misc queries) 0 July 11th 07 03:58 PM
Count Rows macro MikeD1224 Excel Discussion (Misc queries) 3 February 19th 07 08:49 PM
Why is my macro changing sum to count? punter Excel Discussion (Misc queries) 2 June 21st 06 09:51 PM
Need a word-count macro for excel Jack Crane Excel Discussion (Misc queries) 4 March 15th 06 07:22 PM
Is there a word-count macro in excel? Jack Crane Excel Discussion (Misc queries) 6 March 12th 06 03:11 PM


All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"