I have the following code below to remove leading spaces
the macro does what it is supposed to do, but it a bit slow (there just under 1000 rows of data)
It would be appreciated if someone could kindly amend my code so as to speed up the process
the macro does what it is supposed to do, but it a bit slow (there just under 1000 rows of data)
It would be appreciated if someone could kindly amend my code so as to speed up the process
Code:
Sub Remove_Leading_Spaces_CommSheets()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i As Long, LR As Long, R As Range
With Sheets("Data Import")
LR = .Cells(Rows.Count, "A").End(xlUp).Row
For Each R In .Range("A1:E" & LR)
On Error Resume Next
R.Value = LTrim(R.Value)
Next R
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub