View Single Post
  #6   Report Post  
Max
 
Posts: n/a
Default

Yes, its VBA (UDF) and you need to implement it

Steps to implement
---------------------------
Press Alt+F11 to go to VBE

In VBE
---------
Click Insert Module
Copy paste Bob's code** in the whitespace on the right
Press Alt+Q to get back to Excel

**everything from "ColorIndex Function" till "End of ColorIndex Function"

In Excel
-----------
With a sample of colors pasted (via copy paste special formats ok)
into say E2:E5

Put in D2: =ColorIndex(E2)
Copy down to D5

D2:D5 returns the colorindexes for the corresponding cells in E2:E5

To count the no of cells within a certain source range with the color, just
use something like in H2:

=SUMPRODUCT(--(ColorIndex($B$2:$B$11)=G2))

where G2 holds the colorindex (e.g.: 3 [for red]),
and B2:B11 is the source range

(I'll try to post [a link] to a sample file a bit later ... )

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Kelly Lim" wrote in message
...
err...sorry....do i have to use the VBA code in the url given? or just

tried
the formulas for Excel? coz i tried..and it doesnt work....mind to give me

a
step by step advice? please...
Thank you....