Count number of characters in a cell excluding spaces
Macro Title:
|
Worksheet Variable:
|
Worksheet Name:
|
Cell Reference:
enter the cell from which you want to count the number of characters |
Output Cell:
|
First Comment:
' |
Second Comment:
' |
Sub Count_number_of_characters_in_a_cell_excluding_spaces()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count the total number of characters in a cell, excluding spaces
ws.Range("C5") = Len(Application.WorksheetFunction.Substitute(ws.Range("B5"), " ", ""))
End Sub
Sub Count_number_of_characters_in_a_cell_excluding_spaces()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count the total number of characters in a cell, excluding spaces
ws.Range("C5") = Len(Application.WorksheetFunction.Substitute(ws.Range("B5"), " ", ""))
ws.Range("C5") = Len(Application.WorksheetFunction.Substitute(ws.Range("B5"), " ", ""))
End Sub