I have a spreadsheet where I want to count a range of cells that have bold text in them, I have done this through a function. However, when someone deletes the value in a cell that has a bold font, the cell still shows the font as being bold and the function still counts it even though it is blank. How can I adapt my function to not count cells with a bold font that are blank, or how do I reset a the font in a cell to regular after the value in it has been deleted? I tried using conditional formatting but that didn't work!
Here is the function code
Here is the function code
Code:
Function CountBold(WorkRng As Range)Dim Rng As Range
Dim xCount As Long
For Each Rng In WorkRng
If Rng.Font.Bold Then
xCount = xCount + 1
End If
Next
CountBold = xCount
End Function