I followed these directions on the MS web page
On the Tools menu, point to Macro, and then click Visual Basic Editor.
On the Insert menu in the Microsoft Visual Basic window, click Module.
In the Modulen window, type the code for your function.
<here I copied in the text from the referenced page
On the File menu, click Close and Return to Microsoft Excel.
On the worksheet, use your function in formulas as you would any worksheet
function.
I no longer get a #NAME? error but it still does not return a value. Do you
know how you know for sure whta the value of a color is on the pallet. Since
they are laid out in gride I assumed counting starts top left then progresses
like reading. I may be that I have the wrong value for the color.
Thanks again
"Bob Phillips" wrote:
Did you put the code in a normal code module, not a sheet module?
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Randy" wrote in message
...
Sorry I gave you the wrong reference i used this link to find a formula
http://www.xldynamic.com/source/xld.ColourCounter.html
"Randy" wrote:
Thanks bob,
i tried that but get a #NAME? error.
I took the forumal at the site you sent and set up for my sheet as below
=SUMPRODUCT(--(ColorIndex(C7:Z7)=3))
Any suggestion on what I may have done wrong?
Thanks
Randy
"Bob Phillips" wrote:
Randy,
There is a counting solution at
http://xldynamic.com/xld.ColourCounter.html
which counts coloured cells. If you mean shaded as in pattern, it
could be
amended to that as well.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Randy" wrote in message
...
I have built a scheduling templet and would like to be able to count
the
number of cells that shaded. Where shaded cells represent hours
worked.
Any
ideas?