Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
I'm using a VBA code that works great in removed blank spaces until I try to select cells that are scattered about on my worksheet (select by pressing Ctrl and left click mouse). I am wondering is there something I can do to make the VBA work no matter what cells I select? Thank you,
VBA Code:
Sub Trim()
Dim rng As Range
Set rng = Selection
rng.Value = Application.Trim(rng)
End Sub