Dazzawm
Well-known Member
- Joined
- Jan 24, 2011
- Messages
- 3,786
- Office Version
- 365
- Platform
- Windows
I was given the code below to run a Trim Macro. I have 10000 rows and 30 columns of data for it check and it takes forever and sometimes freezes. Is there anyway it can be speeded up please?
Code:
Sub trimCells()
Application.ScreenUpdating = False
For Each c In ActiveSheet.UsedRange
c.Value = WorksheetFunction.Trim(c.Value)
Next c
Application.ScreenUpdating = True
End Sub