I have the following code and it does exactly what I need it to do however, the loop takes far too long to run (3 minutes +). I am new to VBA so I am not exactly sure 1) wha
Suggestion 1
Replace:
If Sheets("Sheet1").Range(Cells(i, 3), Cells(i, 3)) = "Police"
And Sheets("Sheet1").Range(Cells(i, 14), Cells(i, 14)) = "Bi-wkly Uniform Pay" Then _
Sheets("Sheet1").Range(Cells(i, 3), Cells(i, 3)) = "Police - Uniform"
by:
With Sheets("Sheet1")
If .Range(Cells(i, 3), Cells(i, 3)) = "Police" _
And .Range(Cells(i, 14), Cells(i, 14)) = "Bi-wkly Uniform Pay" Then _
.Range(Cells(i, 3), Cells(i, 3)) = "Police - Uniform"
End With
Suggestion 2
Replace:
.Range(Cells(i, 3), Cells(i, 3))
by
.Cells(i, 3)
Suggestion 3
Add:
Application.ScreenUpdating = False
Without this statement, the screen is repainted for every change. That chews up more time than anything else.