Ich möchte folgendes Makro noch weiterentwickeln, sodass ich zum Löschen Werte in 2 Spalten überprüfen kann:
Werte 1, 2, A und B in Spalte C
Sub Zeilen_Löschen_1()
Dim Zeile As Long
Dim intLastRow As Long
Application.ScreenUpdating = False
intLastRow = Cells(Rows.Count, 1).End(xlUp).Row
For Zeile = intLastRow To 1 Step -1
If Cells(Zeile, 3).Value 1 And Cells(Zeile, 3).Value 2 And Cells(Zeile, 3).Value " _
A" _
And Cells(Zeile, 3).Value "B" Then Rows(Zeile).Delete
Next Zeile
Application.ScreenUpdating = True
End Sub
Versuch Löschen wenn Wert 1 in Spalte C und Wert = ok in Spalte D
Sub Zeilen_Löschen_test()
Dim Zeile As Long
Dim intLastRow As Long
Application.ScreenUpdating = False
intLastRow = Cells(Rows.Count, 1).End(xlUp).Row
For Zeile = intLastRow To 1 Step -1
If Cells(Zeile, 3).Value 1 And Cells(Zeile, 4).Value = "ok" Then Rows(Zeile).Delete
Next Zeile
Application.ScreenUpdating = True
End Sub
Dieses Makro funktioniert nicht. Was ist nicht logisch?
Vielen Dank Gregor