Guten Morgen,
ich bekomme es einfach nicht hin, diese zwei Anweisung zusammen zu bekommen. Es erscheint jedesmal die Meldung "Fehler beim Kompilieren Else ohne If Anweisung"
Kann mir jemand helfen?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer
Dim Loletzte As Long
If Target.Column <> 21 Then Exit Sub
If IsEmpty(Target) Then Exit Sub
If UCase(Target.Value) = "ERLEDIGT" Then
With Worksheets("Lettershop_ereldigt")
iRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
Rows(Target.Row).Copy .Rows(iRow)
Rows(Target.Row).Delete
End With
Application.CutCopyMode = False
End If
ElseIf Target.Count = 1 Then
If Target.Column = 7 And Target = 3 Then
With Worksheets("Tabelle2")
Loletzte = IIf(IsEmpty(.Cells(.Rows.Count, 1)), .Cells(.Rows.Count, 1).End(xlUp).Row, .Rows.Count) + 1
Range(Cells(Target.Row, 1), Cells(Target.Row, 2)).Copy .Cells(Loletzte, 1)
Cells(Target.Row, 5).Copy .Cells(Loletzte, 3)
End With
End If
End If
End If
End Sub
Vielen Dank und Grüße