Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Code For Count on Conditional formatting

Hello all,

I am looking to have code once a macro runs to be able the do a count on the
conditional formatting the was triggered on a tab. So condition1 states turn
red if the cell value is greater than 30. After a macro runs a msgbox states
there are 33 counts of condition1 on sheet1 tab.

Thanks,
Aaron
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Code For Count on Conditional formatting

Aaron

Do you really need a macro ?

Why not just a COUNTIF ?

=COUNTIF(B:IV,"30") anywhere in column A

or

=COUNTIF(A2:A65536,"30")+COUNTIF(B:IV,"30") in cell A1

But, if you must:

Sub CountGT30_1()
MsgBox WorksheetFunction.CountIf(Range("A:IV"), "30")
End Sub

Sub CountGT30_2()
MsgBox WorksheetFunction.CountIf(Cells, "30")
End Sub

Sub CountGT30_3()
MsgBox WorksheetFunction.CountIf(Columns("A:IV"), "30")
End Sub

Sub CountGT30_4()
MsgBox WorksheetFunction.CountIf(Rows("1:65536"), "30")
End Sub

Regards

Trevor


"Aaron" wrote in message
...
Hello all,

I am looking to have code once a macro runs to be able the do a count on
the
conditional formatting the was triggered on a tab. So condition1 states
turn
red if the cell value is greater than 30. After a macro runs a msgbox
states
there are 33 counts of condition1 on sheet1 tab.

Thanks,
Aaron



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
COUNT IF - Conditional Formatting KC Excel Discussion (Misc queries) 2 October 30th 09 04:38 PM
COUNT CELLS WITH CONDITIONAL FORMATTING PEGWINN Excel Worksheet Functions 6 September 22nd 07 06:03 PM
Count conditional formatting gocats Excel Programming 5 August 25th 05 02:42 AM
Count and Sum with Conditional Formatting Problem pmahajan Excel Worksheet Functions 1 December 14th 04 05:30 AM
Count Conditional Formatting LD[_2_] Excel Programming 5 October 14th 03 10:51 PM


All times are GMT +1. The time now is 03:56 PM.

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

About Us

"It's about Microsoft Excel"