Have a search of the VBA forum: Forum707 wherre this has been discussed several times previously
Rgds, Geoff
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
Thnx for your help.
I think I can do something with the function below.
Function FntColor() As String
If .Font.Color = RGB(0, 0, 0) Then
FntColor = "black"
ElseIf .Font.Color = RGB(255, 0, 0) Then
FntColor = "red"
Else: FntColor() = "normal"
End If
End If
End Function
One question left....
What do I have to put in front of .Font.Color to get this working in
=COUNTIF(B5:B10,FntColor = "black")
Notice the PERIOD preceeding the Font object in the code you posted. THAT needs to be preceeded by a range object. Please post in forum707 to get help with this.
Skip, Just traded in my old subtlety... for a NUANCE!
Seriously - just search the VBA forum for "Sum By Colour" - there are functions already written to do exactly what you want
Rgds, Geoff
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.