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

We found Chip Pearson's site: http://www.cpearson.com/excel/CFColors.htm with
some code that is supposed to count the cells with conditional formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a specified
conditional format applied. Set the last argument to -1 to look at all format
conditions, or a number between 1 and 3 to specify a particular condition.
This function requires the ActiveCondition function. You can call this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the code for
the Active Condition Function and the GetStripped Function pasted in the same
module.

In the cell where we want the count to appear, we enter the CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we get a
circular reference, even though the cell with the formula is not listed in
the range.

Any ideas what we might be doing wrong?
--
maryj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Count cells with Conditional Formatting

It might be that your CF is formula based, as I recall Chip's code doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
We found Chip Pearson's site: http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a specified
conditional format applied. Set the last argument to -1 to look at all
format
conditions, or a number between 1 and 3 to specify a particular condition.
This function requires the ActiveCondition function. You can call this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the code
for
the Active Condition Function and the GetStripped Function pasted in the
same
module.

In the cell where we want the count to appear, we enter the CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we get a
circular reference, even though the cell with the formula is not listed in
the range.

Any ideas what we might be doing wrong?
--
maryj



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Count cells with Conditional Formatting

Can't de-bug your worksheet without seeing the contents. If you just need to
count cells that have conditional formats, try something like:

Function cf_cnt(r As Range) As Double
cf_cnt = 0
For Each rr In r
If rr.FormatConditions.Count 0 Then
cf_cnt = cf_cnt + 1
End If
Next
End Function

--
Gary's Student
gsnu200704


"maryj" wrote:

We found Chip Pearson's site: http://www.cpearson.com/excel/CFColors.htm with
some code that is supposed to count the cells with conditional formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a specified
conditional format applied. Set the last argument to -1 to look at all format
conditions, or a number between 1 and 3 to specify a particular condition.
This function requires the ActiveCondition function. You can call this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the code for
the Active Condition Function and the GetStripped Function pasted in the same
module.

In the cell where we want the count to appear, we enter the CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we get a
circular reference, even though the cell with the formula is not listed in
the range.

Any ideas what we might be doing wrong?
--
maryj

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

Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False" value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific with any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
We found Chip Pearson's site: http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a specified
conditional format applied. Set the last argument to -1 to look at all
format
conditions, or a number between 1 and 3 to specify a particular condition.
This function requires the ActiveCondition function. You can call this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the code
for
the Active Condition Function and the GetStripped Function pasted in the
same
module.

In the cell where we want the count to appear, we enter the CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we get a
circular reference, even though the cell with the formula is not listed in
the range.

Any ideas what we might be doing wrong?
--
maryj




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Count cells with Conditional Formatting

Are you passing the correct colorindex to the function, and do any cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False" value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific with any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a
specified
conditional format applied. Set the last argument to -1 to look at all
format
conditions, or a number between 1 and 3 to specify a particular
condition.
This function requires the ActiveCondition function. You can call this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the
code
for
the Active Condition Function and the GetStripped Function pasted in
the
same
module.

In the cell where we want the count to appear, we enter the CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we get
a
circular reference, even though the cell with the formula is not listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj








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

Bob,
Yes to both questions. I am looking for cells with a red fill color and the
CFColorIndex function does return 3 for a value. There are about 15-20 cells
within the range that have a red fill color.
--
maryj


"Bob Phillips" wrote:

Are you passing the correct colorindex to the function, and do any cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False" value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific with any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a
specified
conditional format applied. Set the last argument to -1 to look at all
format
conditions, or a number between 1 and 3 to specify a particular
condition.
This function requires the ActiveCondition function. You can call this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the
code
for
the Active Condition Function and the GetStripped Function pasted in
the
same
module.

In the cell where we want the count to appear, we enter the CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we get
a
circular reference, even though the cell with the formula is not listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Count cells with Conditional Formatting

Can you send me your workbook, I cannot think of anything obvious?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
Bob,
Yes to both questions. I am looking for cells with a red fill color and
the
CFColorIndex function does return 3 for a value. There are about 15-20
cells
within the range that have a red fill color.
--
maryj


"Bob Phillips" wrote:

Are you passing the correct colorindex to the function, and do any cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False"
value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific with
any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a
specified
conditional format applied. Set the last argument to -1 to look at
all
format
conditions, or a number between 1 and 3 to specify a particular
condition.
This function requires the ActiveCondition function. You can call
this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the
code
for
the Active Condition Function and the GetStripped Function pasted in
the
same
module.

In the cell where we want the count to appear, we enter the
CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we
get
a
circular reference, even though the cell with the formula is not
listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Count cells with Conditional Formatting

Sure! How do I get it to you?
--
maryj


"Bob Phillips" wrote:

Can you send me your workbook, I cannot think of anything obvious?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
Bob,
Yes to both questions. I am looking for cells with a red fill color and
the
CFColorIndex function does return 3 for a value. There are about 15-20
cells
within the range that have a red fill color.
--
maryj


"Bob Phillips" wrote:

Are you passing the correct colorindex to the function, and do any cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False"
value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific with
any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a
specified
conditional format applied. Set the last argument to -1 to look at
all
format
conditions, or a number between 1 and 3 to specify a particular
condition.
This function requires the ActiveCondition function. You can call
this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have the
code
for
the Active Condition Function and the GetStripped Function pasted in
the
same
module.

In the cell where we want the count to appear, we enter the
CountofCf
function with the range and the number of the Conditional Formatting
condition. We either get a 0, when there should be a number, or we
get
a
circular reference, even though the cell with the formula is not
listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj









  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Count cells with Conditional Formatting

my email address in the posting is

check my signature to see how to change it.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
Sure! How do I get it to you?
--
maryj


"Bob Phillips" wrote:

Can you send me your workbook, I cannot think of anything obvious?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,
Yes to both questions. I am looking for cells with a red fill color and
the
CFColorIndex function does return 3 for a value. There are about 15-20
cells
within the range that have a red fill color.
--
maryj


"Bob Phillips" wrote:

Are you passing the correct colorindex to the function, and do any
cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False"
value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific
with
any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in
my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a
specified
conditional format applied. Set the last argument to -1 to look
at
all
format
conditions, or a number between 1 and 3 to specify a particular
condition.
This function requires the ActiveCondition function. You can
call
this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have
the
code
for
the Active Condition Function and the GetStripped Function pasted
in
the
same
module.

In the cell where we want the count to appear, we enter the
CountofCf
function with the range and the number of the Conditional
Formatting
condition. We either get a 0, when there should be a number, or
we
get
a
circular reference, even though the cell with the formula is not
listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Count cells with Conditional Formatting

I emailed the file to you last Friday. Did you receive it?
--
maryj


"Bob Phillips" wrote:

my email address in the posting is

check my signature to see how to change it.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
Sure! How do I get it to you?
--
maryj


"Bob Phillips" wrote:

Can you send me your workbook, I cannot think of anything obvious?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,
Yes to both questions. I am looking for cells with a red fill color and
the
CFColorIndex function does return 3 for a value. There are about 15-20
cells
within the range that have a red fill color.
--
maryj


"Bob Phillips" wrote:

Are you passing the correct colorindex to the function, and do any
cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a "False"
value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific
with
any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in
my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have a
specified
conditional format applied. Set the last argument to -1 to look
at
all
format
conditions, or a number between 1 and 3 to specify a particular
condition.
This function requires the ActiveCondition function. You can
call
this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also have
the
code
for
the Active Condition Function and the GetStripped Function pasted
in
the
same
module.

In the cell where we want the count to appear, we enter the
CountofCf
function with the range and the number of the Conditional
Formatting
condition. We either get a 0, when there should be a number, or
we
get
a
circular reference, even though the cell with the formula is not
listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj














  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Count cells with Conditional Formatting

Yes, I have just been in to the account and seen it. I have responded.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"maryj" wrote in message
...
I emailed the file to you last Friday. Did you receive it?
--
maryj


"Bob Phillips" wrote:

my email address in the posting is

check my signature to see how to change it.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Sure! How do I get it to you?
--
maryj


"Bob Phillips" wrote:

Can you send me your workbook, I cannot think of anything obvious?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"maryj" wrote in message
...
Bob,
Yes to both questions. I am looking for cells with a red fill color
and
the
CFColorIndex function does return 3 for a value. There are about
15-20
cells
within the range that have a red fill color.
--
maryj


"Bob Phillips" wrote:

Are you passing the correct colorindex to the function, and do any
cells
meet the CF conditions.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in
my
addy)



"maryj" wrote in message
...
Bob,

You are exactly right - the CF is formula based.
I'm trying your CFColorCount function but it is returning a
"False"
value.
The CFColorIndex function returns the correct value.

Thanks for your help!

BTW, I'm not real knowledgeable about code so please be specific
with
any
suggestions to changes. And patient :) Thanks!
--
maryj


"Bob Phillips" wrote:

It might be that your CF is formula based, as I recall Chip's
code
doesn't
cater for that. See here if so
http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail
in
my
addy)



"maryj" wrote in message
...
We found Chip Pearson's site:
http://www.cpearson.com/excel/CFColors.htm
with
some code that is supposed to count the cells with conditional
formatting
applied. But we can not get it to work. What are we
missing????

We are trying to use this:
CountOfCF
This function return the number of cells in a range that have
a
specified
conditional format applied. Set the last argument to -1 to
look
at
all
format
conditions, or a number between 1 and 3 to specify a
particular
condition.
This function requires the ActiveCondition function. You can
call
this
function directly from a worksheet cell with a formula like:
=CountOfCF(A1:A10,1)

We have that function in a module in the workbook. We also
have
the
code
for
the Active Condition Function and the GetStripped Function
pasted
in
the
same
module.

In the cell where we want the count to appear, we enter the
CountofCf
function with the range and the number of the Conditional
Formatting
condition. We either get a 0, when there should be a number,
or
we
get
a
circular reference, even though the cell with the formula is
not
listed
in
the range.

Any ideas what we might be doing wrong?
--
maryj














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 CELLS WITH CONDITIONAL FORMATTING PEGWINN Excel Worksheet Functions 6 September 22nd 07 06:03 PM
Count cells that meetin conditional formatting criteria chad Excel Worksheet Functions 6 January 5th 07 10:30 AM
How to count the number of cells highlighted using Conditional Formatting feature present in Format Menu of Excel??? divya Excel Programming 3 November 1st 06 12:47 PM
Count Conditional Formatting LD[_2_] Excel Programming 5 October 14th 03 10:51 PM


All times are GMT +1. The time now is 03:14 AM.

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"