Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default COUNTIF depending on cell fill colour

Hi,

Is it posible and how, to count number of cells in a range that are a
perticular fill colour.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default COUNTIF depending on cell fill colour

See:

http://www.cpearson.com/excel/colors.htm

for a very good explanation
--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Hi,

Is it posible and how, to count number of cells in a range that are a
perticular fill colour.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default COUNTIF depending on cell fill colour

SORTED!

Thank Gary & Chip

"Gary''s Student" wrote:

See:

http://www.cpearson.com/excel/colors.htm

for a very good explanation
--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Hi,

Is it posible and how, to count number of cells in a range that are a
perticular fill colour.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default COUNTIF depending on cell fill colour

Thanks Gary,

Got it to work, but if the range's color is changed by conditional
formatting CountByColor does not work?, any ideas?

"Gary''s Student" wrote:

See:

http://www.cpearson.com/excel/colors.htm

for a very good explanation
--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Hi,

Is it posible and how, to count number of cells in a range that are a
perticular fill colour.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default COUNTIF depending on cell fill colour

If the colors are painted by Conditional Formatting then the code can
actually ignore the color and focus on the condition itself.


Consider this simple example:

Let's say cells A1 thru A100 have been condtionally formatted to be bold if
the value is greater than 10. This allows us dis-regard the boldness and
instead:

Sub LaDdIe()
IAmTheCount = 0
For i = 1 To 100
If Cells(i, "A").Value 10 Then
IAmTheCount = IAmTheCount + 1
End If
Next
MsgBox (IAmTheCount)
End Sub


Bob Phillips does a great job of reviewing this topic in:

http://www.xldynamic.com/source/xld.CFConditions.html

--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Thanks Gary,

Got it to work, but if the range's color is changed by conditional
formatting CountByColor does not work?, any ideas?

"Gary''s Student" wrote:

See:

http://www.cpearson.com/excel/colors.htm

for a very good explanation
--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Hi,

Is it posible and how, to count number of cells in a range that are a
perticular fill colour.

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default COUNTIF depending on cell fill colour

wOw.

"Gary''s Student" wrote:

If the colors are painted by Conditional Formatting then the code can
actually ignore the color and focus on the condition itself.


Consider this simple example:

Let's say cells A1 thru A100 have been condtionally formatted to be bold if
the value is greater than 10. This allows us dis-regard the boldness and
instead:

Sub LaDdIe()
IAmTheCount = 0
For i = 1 To 100
If Cells(i, "A").Value 10 Then
IAmTheCount = IAmTheCount + 1
End If
Next
MsgBox (IAmTheCount)
End Sub


Bob Phillips does a great job of reviewing this topic in:

http://www.xldynamic.com/source/xld.CFConditions.html

--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Thanks Gary,

Got it to work, but if the range's color is changed by conditional
formatting CountByColor does not work?, any ideas?

"Gary''s Student" wrote:

See:

http://www.cpearson.com/excel/colors.htm

for a very good explanation
--
Gary''s Student - gsnu200726


"LaDdIe" wrote:

Hi,

Is it posible and how, to count number of cells in a range that are a
perticular fill colour.

Thanks

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
colour of a row depending on cell value Maax Excel Discussion (Misc queries) 6 February 8th 07 05:30 PM
Change colour of cell depending on content blain Excel Programming 9 June 17th 06 01:47 PM
Change colour of cell depending on content Norman Jones Excel Programming 1 June 16th 06 10:23 AM
Change colour of cell depending on content tony h[_134_] Excel Programming 0 June 16th 06 10:16 AM
Changing cell colour depending on another cells value... Web master Excel Discussion (Misc queries) 3 January 10th 06 12:30 PM


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