startzeile = 2
Spalte = 2
startzeile2 = 2
Sheets(1).Select
Letzte_Zeile = Range(Cells(60000, Spalte), Cells(60000, Spalte)).End(xlUp).Row
For i = startzeile To Letzte_Zeile
If Left(Sheets(1).Cells(i, Spalte), 7) = "ABCDEFG" Or Left(Sheets(1).Cells(i, Spalte), 7) = "BCDEFGH" Or Left(Sheets(1).Cells(i, Spalte), 7) = "CDEFGHI" Or Left(Sheets(1).Cells(i, Spalte), 6) = "ABCDEF" Or Left(Sheets(1).Cells(i, Spalte), 7) = "ABCDEFK" Or Left(Sheets(1).Cells(i, Spalte), 7) = "FGHIJKL" Or Left(Sheets(1).Cells(i, Spalte), 10) = "ABC DEF GH" Or Left(Sheets(1).Cells(i, Spalte), 11) = "ABC DEF GHI" Or Left(Sheets(1).Cells(i, Spalte), 7) = "DEFGHIJ" Or Left(Sheets(1).Cells(i, Spalte), 7) = "EFGHIJK" Or Left(Sheets(1).Cells(i, Spalte), 7) = "ABC DEF" Or Left(Sheets(1).Cells(i, Spalte), 7) = "AB DE C" Or Left(Sheets(1).Cells(i, Spalte), 7) = "FGH IJK" Or Left(Sheets(1).Cells(i, Spalte), 7) = "CDE FGH" Or Left(Sheets(1).Cells(i, Spalte), 7) = "IJKLMNO" Or Left(Sheets(1).Cells(i, Spalte), 7) = "FGHIJKL" Or Left(Sheets(1).Cells(i, Spalte), 7) = "AAA AAA" Or Left(Sheets(1).Cells(i, Spalte), 7) = "AAAA KK" Or Left(Sheets(1).Cells(i, Spalte), 7) = "BB BBBB" Then
Sheets(1).Rows(i & ":" & i).Copy
Sheets(2).Select
Cells(startzeile2, 1).Select
ActiveSheet.Paste
startzeile2 = startzeile2 + 1
Else
End If
Folgender Code klappt super, es gibt nur ein Problem: Ich möchte noch weitere "Or" Zeilen einfügen, aber der VBA Code ist zu lang. wie kann ich in der nächsten Zeile weiterschreiben?
Mit _ und & funktioniert es nicht. Gibt es eine andere Möglichkeit?
Vielen Dank!