With/If Konstruktion
08.12.2020 18:10:39
Sarah
Fehlermeldung: "End With ohne With"
Sub if()
If IsDate(Worksheets("Übersicht").Cells(2, 4).Value) And IsDate(Worksheets("Übersicht").Cells(3, _
4).Value) Then
With Worksheets("Import Bestellformular")
For lngRow = 2 To .Cells(.Rows.Count, 3).End(xlUp).Row Step 10
For lngRow1 = 3 To .Cells(.Rows.Count, 3).End(xlUp).Row Step 10
If IsDate(.Cells(lngRow, 3).Value) And IsDate(.Cells(lngRow, 4).Value) Then
If .Cells(lngRow, 3).Value
.Cells(lngRow, 4).Value >= Worksheets("Übersicht").Cells(3, 4).Value _
Then
If Not IsEmpty(.Cells(lngRow, 14).Value) And _
Not IsEmpty(.Cells(lngRow, 16).Value) Then
...
ElseIf Not IsEmpty(.Cells(lngRow, 14).Value) Then
...
ElseIf Not IsEmpty(.Cells(lngRow, 16).Value) Then
...
Else
...
End If
'---------------------------------------------------------------------------------------------- _
--------lngRow1
If Not IsEmpty(.Cells(lngRow1, 14).Value) And _
Not IsEmpty(.Cells(lngRow1, 16).Value) Then
....
ElseIf Not IsEmpty(.Cells(lngRow1, 14).Value) Then
....
ElseIf Not IsEmpty(.Cells(lngRow1, 16).Value) Then
...
Else
...
End If
End If
End If
Next
'Next lngRow1
End With
End If
End Sub
Was mache ich falsch?