PC Review


Reply
Thread Tools Rate Thread

COUNTIF depending on cell fill colour

 
 
=?Utf-8?B?TGFEZEll?=
Guest
Posts: n/a
 
      2nd Jun 2007
Hi,

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

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      2nd Jun 2007
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 With Quote
 
=?Utf-8?B?TGFEZEll?=
Guest
Posts: n/a
 
      2nd Jun 2007
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

 
Reply With Quote
 
=?Utf-8?B?TGFEZEll?=
Guest
Posts: n/a
 
      2nd Jun 2007
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 With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      2nd Jun 2007
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 With Quote
 
=?Utf-8?B?TGFEZEll?=
Guest
Posts: n/a
 
      2nd Jun 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cell Colour depending on Value in Range =?Utf-8?B?VHJldm9yIFdpbGxpYW1z?= Microsoft Excel Programming 3 27th Jun 2007 04:16 PM
colour of a row depending on cell value =?Utf-8?B?TWFheA==?= Microsoft Excel Misc 6 8th Feb 2007 05:30 PM
Changing cell colour depending on another cells value... Web master Microsoft Excel Discussion 3 10th Jan 2006 12:30 PM
How can i change cell colour depending on month of date in cell? andy75 Microsoft Excel Misc 2 6th Jan 2006 07:46 AM
Countif criteria based on cell's fill colour Mark Keeffe Microsoft Excel Worksheet Functions 1 17th Oct 2003 09:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:00 PM.