Wildcards einsetzen?
28.06.2007 14:36:14
sascha76er
Hallo,
wie kann ich bei folgendem Skript mit Wildcards arbeiten anstatt mit einzelnen Werten?
Sub III_ZeilenKiller()
Dim i As Long, laR As Long
Dim sp As Integer
sp = 2 'Spaltennummer (1=A, 2=B, ...)
Application.ScreenUpdating = False
laR = Cells(Rows.Count, sp).End(xlUp).Row
For i = laR To 1 Step -1
If Cells(i, sp).Value = "ABNH" Or Cells(i, sp).Value = "ALBLSTRECKEM2" Or Cells(i, sp). _
Value = "ALPRSTECKEKG" Or Cells(i, sp).Value = "FRACHT" Or Cells(i, sp).Value = "DELWOSCHLIFFKG" Or Cells(i, sp).Value = "FHVP1" Or Cells(i, sp).Value = "HVB" Or Cells(i, sp).Value = "FFRACHT1" Or Cells(i, sp).Value = "FRACHTA" Or Cells(i, sp).Value = "FRACHTR" Or Cells(i, sp).Value = "HOLZ-EINWEGVERSCHLAG" Or Cells(i, sp).Value = "HVBA" Or Cells(i, sp).Value = "HVPA" Or Cells(i, sp).Value = "KLM" Or Cells(i, sp).Value = "MINDESTR.LACK" Or Cells(i, sp).Value = "NAUTHFRACHT" Or Cells(i, sp).Value = "VERPACKUNG" Or Cells(i, sp).Value = "" Or Cells(i, sp).Value = "ALPRSTRECKEKG" Or Cells(i, sp).Value = "ABNHA" Or Cells(i, sp).Value = "ALBLSTRECKEST" Or Cells(i, sp).Value = "ALPRSTRECKEKG" Or Cells(i, sp).Value = "FHVB1" Or Cells(i, sp).Value = "HVP" Or Cells(i, sp).Value = "MSFERT" Or Cells(i, sp).Value = "VABLSTRECKEKG" Or Cells(i, sp).Value = "ALBLSTRECKEKG" Then
Cells(i, sp).EntireRow.Delete
End If
Next i
Application.ScreenUpdating = True
End Sub
Währe für jede Hilfe sehr dankbar.
Gruß
Sascha Nolden