Good day,
I run the following code for a selection of about 2 million cells and it's very slow (i.e. more than two hours!).
The worksheet is unlocked and there are no formulas linked to these cells...
How can speed up this code? Thanks!
I run the following code for a selection of about 2 million cells and it's very slow (i.e. more than two hours!).
The worksheet is unlocked and there are no formulas linked to these cells...
How can speed up this code? Thanks!
Code:
Sub RemoveSpaces()
Dim cCell As Range
For Each cCell In Selection.Cells
cCell.Value = WorksheetFunction.Trim(cCell.Value)
Next cCell
End Sub