Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Count Conditional Formatting

I am using conditional formatting to display errors (Missing data) on a
sheet.
My range is just from J12 to J27.

I want to prevent printing if one or more of the cells are red.
Allready have the code.
I just need to insert a IF statement to check if there are any cells in that
range that are formatted as red.(Missing Data)

How do I count the cells that are RED as a result of Conditional Formatting?

Any help will be appretiated.
Thanx.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Count Conditional Formatting

To get the colour of the cells, you need to use the Interior property
(believe it or not!)

Also, there are different shades of Red, so you will need to be specific.

"LD" wrote in message
...
I am using conditional formatting to display errors (Missing data) on a
sheet.
My range is just from J12 to J27.

I want to prevent printing if one or more of the cells are red.
Allready have the code.
I just need to insert a IF statement to check if there are any cells in

that
range that are formatted as red.(Missing Data)

How do I count the cells that are RED as a result of Conditional

Formatting?

Any help will be appretiated.
Thanx.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Count Conditional Formatting

This is true. however conditional formatting does not
change the underlying cell formats, so you wont be able to
test it this way.

As is so often the case, Chip Pearson has some potentially
useful thoughts on the subject:
http://www.cpearson.com/excel/CFColors.htm

Pete.
-----Original Message-----
To get the colour of the cells, you need to use the

Interior property
(believe it or not!)

Also, there are different shades of Red, so you will need

to be specific.

"LD" wrote in message
...
I am using conditional formatting to display errors

(Missing data) on a
sheet.
My range is just from J12 to J27.

I want to prevent printing if one or more of the cells

are red.
Allready have the code.
I just need to insert a IF statement to check if there

are any cells in
that
range that are formatted as red.(Missing Data)

How do I count the cells that are RED as a result of

Conditional
Formatting?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Count Conditional Formatting

Normally you would use the same formula that you used to produce
your CF colors to describe such things in your worksheet so you can
count things. Since you want it for programming you might abort
the printing if you have a count in a certain column. Since the basis
is empty cells it might be easier to just program something directly
forgetting that you've done anything for CF in worksheet formulas.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Count Conditional Formatting

If the cells are empty and that is all your conditional formatting checks
for, then check them directly

Dim rng as Range
On Error Resume Next
set rng = Range("J12:J27").SpecialCells(xlBlanks)
On Error goto 0
if rng is nothing then
' there are no blanks
Else
rng.select
Msg "Please fill in missing values"
End if

If you actually need to check the conditions, then follow Peter McCosh's
advice with respect to Chip Pearsons site. Also, as he said, GB is
incorrect.

--
Regards,
Tom Ogilvy

"LD" wrote in message
...
I am using conditional formatting to display errors (Missing data) on a
sheet.
My range is just from J12 to J27.

I want to prevent printing if one or more of the cells are red.
Allready have the code.
I just need to insert a IF statement to check if there are any cells in

that
range that are formatted as red.(Missing Data)

How do I count the cells that are RED as a result of Conditional

Formatting?

Any help will be appretiated.
Thanx.






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Count Conditional Formatting


If you actually need to check the conditions, then follow Peter McCosh's
advice with respect to Chip Pearsons site. Also, as he said, GB is
incorrect.

--
Regards,
Tom Ogilvy


Rats! I thought I could use some of my new-found knowledge. It's obviously
spread a bit too thinly. I stand corrected.

GB




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
How to count cells that are highlighted by conditional formatting jngbutler35 Excel Worksheet Functions 1 February 10th 10 03:35 PM
COUNT IF - Conditional Formatting KC Excel Discussion (Misc queries) 2 October 30th 09 04:38 PM
Conditional formatting based on character count Rhonda H. Excel Worksheet Functions 1 September 3rd 09 12:25 AM
COUNT CELLS WITH CONDITIONAL FORMATTING PEGWINN Excel Worksheet Functions 6 September 22nd 07 06:03 PM
Count and Sum with Conditional Formatting Problem pmahajan Excel Worksheet Functions 1 December 14th 04 05:30 AM


All times are GMT +1. The time now is 08:12 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"