Here's a function for counting characters, using the character and range object. Makes the code a bit smaller. It will work with a single character on multiple ranges, ignoring case, doesn't care what the character is. Will return an error if you use more then 1 character in the selection
syntax
PHP Code:
=CountChar(Range,"character")
=CountChar(A1:A5,"e")
Function CountChar(R As Range, Char As String)
Dim c As Characters, Found As Integer, count1 As Integer, R2 As Range
If Len(Char) <> 1 Then
CountChar = "#N/A"
GoTo Error
End If
For Each R2 In R
For count = 1 To R2.Characters.count
If UCase(R2.Characters(count, 1).Text) = UCase(Char) Then
Found = Found + 1
End If
Next count
Next
CountChar = Found
Error:
End Function
edit:Thanks Dreamboat, It looks great this way.