Count number of characters in a range excluding spaces

Macro Title:
Worksheet Variable:
Worksheet Name:
Range Reference:
enter the range from which you want to count the number of characters
Output Cell:
First Comment:

'
Second Comment:

'
Sub Count_number_of_characters_in_a_range_excluding_spaces()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count the total number of characters in a range
ws.Range("D5").Formula = "=SUMPRODUCT(LEN(SUBSTITUTE(B5:B7,"" "","""")))"

End Sub

Sub Count_number_of_characters_in_a_range_excluding_spaces()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Analysis")
'count the total number of characters in a range

ws.Range("D5").Formula = "=SUMPRODUCT(LEN(SUBSTITUTE(B5:B7,"" "","""")))"

End Sub

Sub Count_number_of_characters_in_a_range_excluding_spaces()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count the total number of characters in a range
ws.Range("D5").Formula = "=SUMPRODUCT(LEN(SUBSTITUTE(B5:B7,"" "","""")))"

End Sub