Make sure you put this in a standard Module (not a sheet o
ThisWorksheet).
Code
-------------------
Public Function countnonwhite(rInput As Range) as Single
Dim nonwhite As Single
nonwhite = 0
countnonwhite = 0
For Each c In ActiveSheet.Range(rInput)
If c.Interior.ColorIndex < -4142 Then nonwhite = nonwhite + 1
Next
countnonwhite = nonwhite
End Su
-------------------
Use it by entering =countnonwhite(A1:C100)
--
Message posted from
http://www.ExcelForum.com