PC Review


Reply
Thread Tools Rate Thread

Count cells with fill color and retain code - Mr. Umlas Can you he

 
 
Counting Cells With Fill Color
Guest
Posts: n/a
 
      3rd Apr 2008
I copied some VBE code from
http://xldynamic.com/source/sld.ColourCounter.html and pasted it into the VBA
editor in my Excel spreadsheet. Then I used '=ColorIndex(cell)='color index
number' to find out what index number my color is. Then I used
'=SumProduct(--(COLORINDEX(cell range)='color index number')) to add up the
cells that have that color. This works great. However, when I save the
Excel document and then need to go back to it, I get a #name? error. Why is
this happening. I really would like to be able to use this code, but can't
figure out why it doesn't work correctly.

Thanks,

Pam Mahan
 
Reply With Quote
 
 
 
 
Billy Liddel
Guest
Posts: n/a
 
      4th Apr 2008
Pam

Press the F9 key to force calculation and it should work. Excel does not
recognise UDFs imediately unless they are installed in an AddIn.

Peter

"Counting Cells With Fill Color" wrote:

> I copied some VBE code from
> http://xldynamic.com/source/sld.ColourCounter.html and pasted it into the VBA
> editor in my Excel spreadsheet. Then I used '=ColorIndex(cell)='color index
> number' to find out what index number my color is. Then I used
> '=SumProduct(--(COLORINDEX(cell range)='color index number')) to add up the
> cells that have that color. This works great. However, when I save the
> Excel document and then need to go back to it, I get a #name? error. Why is
> this happening. I really would like to be able to use this code, but can't
> figure out why it doesn't work correctly.
>
> Thanks,
>
> Pam Mahan

 
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
Is there a way to count cells in a range based on fill color? =?Utf-8?B?ZWVoaW5tZA==?= Microsoft Excel Worksheet Functions 2 16th Mar 2006 05:09 PM
How do I sort or count cells by fill color? =?Utf-8?B?Um9i?= Microsoft Excel Misc 2 23rd Dec 2005 09:37 PM
HOW TO FORMATE CELLS TO COUNT CELLS WITH A FILL COLOR? =?Utf-8?B?TW9vcmU=?= Microsoft Excel New Users 1 15th Jun 2005 06:41 PM
Formula to count the cells in a range that have a fill color. =?Utf-8?B?U2xhaW50ZXZh?= Microsoft Excel Misc 2 19th Jan 2005 08:25 PM
Formula to count the cells in a range that have a fill color. =?Utf-8?B?TW9sbHkgRg==?= Microsoft Excel Misc 2 19th Jan 2005 06:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:11 AM.