Hi,
I have below code where it replaces values in Column B and Column A. Code works fine but its taking too long to run. Is there any way to run it more efficiently and faster?
I have below code where it replaces values in Column B and Column A. Code works fine but its taking too long to run. Is there any way to run it more efficiently and faster?
VBA Code:
Sub TestAll()
Application.ScreenUpdating = False
Worksheets("POS").Activate
Dim i As Long
Dim lr As Long
lr = Range("B" & Rows.Count).End(xlUp).Row
For i = lr To 2 Step -1
If Range("B" & i).Value <> "BIC" And Range("B" & i).Value <> "Newell" And Range("B" & i).Value <> "Crayola" And Range("B" & i).Value <> "Pilot" And _
Range("B" & i).Value <> "Pentel" And Range("B" & i).Value <> "Zebra" Then Range("B" & i).Value = "All Other"
If Range("B" & i).Value <> "BIC" And Range("B" & i).Value <> "Newell " And Range("B" & i).Value <> "Crayola" And Range("B" & i).Value <> "Pilot" And _
Range("B" & i).Value <> "Pentel" And Range("B" & i).Value <> "Zebra" Then Range("A" & i).Value = "All Other"
Worksheets("POS").Range("B" & i).Value = Replace(Worksheets("POS").Range("B" & i), "Zebra Tires", "Zebra")
Worksheets("POS").Range("B" & i).Value = Replace(Worksheets("POS").Range("B" & i), "Newell Tires", "Newell")
Worksheets("POS").Range("B" & i).Value = Replace(Worksheets("POS").Range("B" & i), "Pilot Tires", "Pilot")
Next i
Application.ScreenUpdating = True
End Sub