No problem.
There are three types of macros: General, Sheet, and ThisWorkbook.
This is a general macro
- Copy macro from post above
- Select Ctrl + F11 (Opens VBE)
- Select Ctrl + R (Only if project tree on the left side of the screen is not open)
- Select Insert on toolbar >> Module
- Paste macro on right side of screen
- Select Alt + Q (Closes the VBE and return you to Excel)
Lets say your range is A1:H20 and the color you want to count first occurs in C3.
In a open cell enter =COUNTCOLOR(C3,A1:H20)
NOTE: A User Defined Function (UDF) will not recalculate all by itself; instead, Ctrl + Alt + F9
Bookmarks