Grundlegendes zum VBA-Code mit "TO" und "STEP"
Ich habe diesen Code bekommen, um in Excel zu laufen, aber ich versuche zu verstehen, was das bedeutet. Ich möchte vor allem den variablen Anteil kennenlernen? Jede Hilfe wäre sehr dankbar.
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