Why does this Public Function not return the correct word count and instead provides a value of "0":
VBA Code:
Public Function CountWords(NumRange As Range) As Long
Dim rCell As Range, lCount As Long
For Each rCell In NumRange
lCount = lCount + Len(Trim(rCell)) - Len(Replace(Trim(rCell), "", "")) + 1
Next rCell
CountWords = lCount
End Function
Last edited by a moderator: