talkinggoat
New Member
- Joined
- Feb 1, 2022
- Messages
- 33
- Office Version
- 365
- Platform
- Windows
When I execute this script, it causes Excel to become unresponsive, assumingly while it operates, but it's not complicated. It locks up for about 10 minutes. This is on an 8-core i7 with 32gb of ram and an SSD. The sheet is a single column as text, with about 9400 rows. Is this normal or did I do something wrong?
VBA Code:
Sub TrimWhiteSpace ()
Dim rng as Range
Set rng as Selection
For Each cell In rng
cell.Value = Trim(cell)
Next cell
End sub