Hallo VBA Profis,
Ich bin gerade mit einem Makro beschäftigt welches eine 4stellige Anzahl an Nummern beinhalten soll um diese mit einer ähnlichen Excel Liste zu vergliechen und in dieser dann die übereinstimmenden Reihen löschen. Ich finde jedoch keine Möglichkeit, das effizient und platzsparend darzustellen.
Sub Makro1()
Dim i
For i = 1 To 100
Cells(i, 8).Select
If Selection = ("46454") Then Selection.EntireRow.Delete
If Selection = ("47312") Then Selection.EntireRow.Delete
If Selection = ("84083") Then Selection.EntireRow.Delete
If Selection = ("84085") Then Selection.EntireRow.Delete
If Selection = ("84089") Then Selection.EntireRow.Delete
If Selection = ("78003") Then Selection.EntireRow.Delete
If Selection = ("78005") Then Selection.EntireRow.Delete
If Selection = ("78007") Then Selection.EntireRow.Delete
If Selection = ("78009") Then Selection.EntireRow.Delete
If Selection = ("47312") Then Selection.EntireRow.Delete
If Selection = ("84083") Then Selection.EntireRow.Delete
If Selection = ("52003") Then Selection.EntireRow.Delete
If Selection = ("52004") Then Selection.EntireRow.Delete
If Selection = ("52005") Then Selection.EntireRow.Delete
If Selection = ("52006") Then Selection.EntireRow.Delete
If Selection = ("57621") Then Selection.EntireRow.Delete
If Selection = ("68144") Then Selection.EntireRow.Delete
If Selection = ("84087") Then Selection.EntireRow.Delete
If Selection = ("78011") Then Selection.EntireRow.Delete
If Selection = ("41032") Then Selection.EntireRow.Delete
Next i
End Sub
Das ist nur ein sehr kleiner Ausschnitt der gegebenen Nummern.
|