Mit untenstehender Auftstellung funktioniert es problemlos!
Dim lRow2 As Long
For lRow2 = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If IsDate(Cells(lRow2, 6)) Then
If CDate(Cells(lRow2, 6)) >= Date Then
' If CDate(Cells(lRow2, 6)) = Date - 1 Then
' If CDate(Cells(lRow2, 6)) = Date - 2 Then
' If CDate(Cells(lRow2, 6)) = Date - 3 Then
Cells(lRow2, 6).EntireRow.Delete xlShiftUp
End If
' End If
' End If
' End If
End If
Next lRow2
For lRow2 = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If IsDate(Cells(lRow2, 6)) Then
' If CDate(Cells(lRow2, 6)) >= Date Then
If CDate(Cells(lRow2, 6)) = Date - 1 Then
' If CDate(Cells(lRow2, 6)) = Date - 2 Then
' If CDate(Cells(lRow2, 6)) = Date - 3 Then
Cells(lRow2, 6).EntireRow.Delete xlShiftUp
' End If
End If
' End If
' End If
End If
Next lRow2
Dim lRow2 As Long
For lRow2 = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If IsDate(Cells(lRow2, 6)) Then
' If CDate(Cells(lRow2, 6)) >= Date Then
' If CDate(Cells(lRow2, 6)) = Date - 1 Then
If CDate(Cells(lRow2, 6)) = Date - 2 Then
' If CDate(Cells(lRow2, 6)) = Date - 3 Then
Cells(lRow2, 6).EntireRow.Delete xlShiftUp
' End If
' End If
End If
' End If
End If
Next lRow2
Dim lRow2 As Long
For lRow2 = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If IsDate(Cells(lRow2, 6)) Then
' If CDate(Cells(lRow2, 6)) >= Date Then
' If CDate(Cells(lRow2, 6)) = Date - 1 Then
' If CDate(Cells(lRow2, 6)) = Date - 2 Then
If CDate(Cells(lRow2, 6)) = Date - 3 Then
Cells(lRow2, 6).EntireRow.Delete xlShiftUp
' End If
' End If
' End If
End If
End If
Next lRow2
|