bushidowarrior
Board Regular
- Joined
- Jun 27, 2011
- Messages
- 84
- Office Version
- 2019
- Platform
- Windows
Hello,
I have this code however, I would like to make it run across the entire workbook:
I thought it would be: ActiveWorkBook.UsedRange, but no.
Thank you
I have this code however, I would like to make it run across the entire workbook:
Code:
Sub RemoveLeadingTrailingSpaces()
Dim r As Range
For Each r In ActiveSheet.UsedRange
v = r.Value
If v <> "" Then
If Not r.HasFormula Then
r.Value = Trim(v)
End If
End If
Next r
End Sub
Thank you
Last edited: