Entendendo o código VBA usando "TO" e "STEP"
Recebi esse código para executar no Excel, mas estou tentando entender o que isso significa. Gostaria especialmente de saber a parte variável? Qualquer ajuda seria muito apreciada.
sub SortNames
Dim LR As Long
Application.ScreenUpdating = False
Sheets("Stores").Select
LR = Cells(Rows.Count, 1).End(xlUp).Row
For i = LR To 2 Step -1
'Here is where you can add the names
If Range("f" & i) <> "Amanda Weaver" And Range("f" & i) <> "Debra Wiesemann" And _
Range("f" & i) <> "Drew Simpson" And Range("f" & i) <> "James Howard" And _
Range("f" & i) <> "Jeff Hruby" And Range("f" & i) <> "Jessica Czupryn" And _
Range("f" & i) <> "Kevin Janke" And Range("f" & i) <> "Matthew Hudspeath" And _
Range("f" & i) <> "Maurey Peterson" And Range("f" & i) <> "Noah Hadro" And _
Range("f" & i) <> "Thomas McHenry" And Range("f" & i) <> "Thomas McHenry" Then
Range("f" & i).EntireRow.Delete Shift:=xlUp
End If
Next i
Application.ScreenUpdating = True
End Sub