Hallo Sandra,
Option Explicit
Option Base 1
Sub Zeilenweg()
Dim zeile, Anfang, erg As Boolean, a
Anfang = Array("292", "293", "294")
For zeile = 1 To WorksheetFunction.Max(Cells(Rows.Count, 1).End(xlUp).Row, _
Cells(Rows.Count, 2).End(xlUp).Row)
erg = False
For Each a In Anfang
If InStr(1, Trim(Cells(zeile, 1)), a) = 1 Then
erg = True
Exit For
End If
Next a
If erg Then
While IsEmpty(Cells(zeile + 1, 1)) And Not IsEmpty((Cells(zeile + 1, 2)))
Rows(zeile + 1).Delete shift:=xlUp
Wend
End If
Next zeile
End Sub
sollte Dein Problem lösen.
Gruß der AlteDresdner
|