I have a sumbold UDF that works like it should. What I now would like is a function that works similarly. I would like a countabold function. What I would like to do is count the number of cells that have TEXT in it that is bold. I know in order to count text I must use the counta function instead of just the count function. My macro looks like this:
Function COUNTABOLD(myRange) As Double
Application.Volatile True
COUNTABOLD = 0
For Each c In myRange
If c.Font.Bold = True Then COUNTABOLD = COUNTABOLD + c.Value
Next c
End Function
Is this even possible to do? If so where did I go wrong? I am returning a #VALUE! when I use the above macro.
Any help would be greatly appreciated.
Bill
Function COUNTABOLD(myRange) As Double
Application.Volatile True
COUNTABOLD = 0
For Each c In myRange
If c.Font.Bold = True Then COUNTABOLD = COUNTABOLD + c.Value
Next c
End Function
Is this even possible to do? If so where did I go wrong? I am returning a #VALUE! when I use the above macro.
Any help would be greatly appreciated.
Bill