I have up till now been using the code below to delete excessive spaces
Dim r As Range
Dim Target As Range
Set Target = ActiveSheet.Range("C1:C3000")
For Each r In Target
If Len(r.Value) <> Len(Trim(r.Value)) Then
r.Value = Application.Trim(r.Value)
End If
Next
Which seems to have worked well up till now
I have discovered that if I have a phrase in column C for example
testing testing
the code does not pick up on the fact that this has two spaces between both words, I had thought it would delete all excessive spaces, not just what is before and after
Does anyone have any ideas please ?
Dim r As Range
Dim Target As Range
Set Target = ActiveSheet.Range("C1:C3000")
For Each r In Target
If Len(r.Value) <> Len(Trim(r.Value)) Then
r.Value = Application.Trim(r.Value)
End If
Next
Which seems to have worked well up till now
I have discovered that if I have a phrase in column C for example
testing testing
the code does not pick up on the fact that this has two spaces between both words, I had thought it would delete all excessive spaces, not just what is before and after
Does anyone have any ideas please ?