ich habe einen kleinen Fehler in meinem VBA Code.
Finde ihn aber nicht.
Er funktioniert insoweit, dass wenn eine Eingabe in Feld 5 erfolgt die Felder D und H
nach unten kopiert werden.
Das gleiche wolte ich nun in Feld M bewirken.
Leider bleibt das Feld M aber leer.
Warum das ?
Gruß
Erik
Dim LR&
Dim d As Date
Dim r As Range
' Stop
If Not Intersect(Target, Range("D7:D200")) Is Nothing Then
If Target.Count <> 1 Then
MsgBox "Bitte nur einzeln ändern"
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
Else
If Target.Value <> "" Then
LR = Cells(Rows.Count, 5).End(xlUp).Row
If Target.Row < LR Then
d = Format(Now, "dd.mm.yyyy")
Set r = Intersect(Range("D" & Target.Row + 1).Resize(LR - Target.Row, 1), _
Cells.SpecialCells(xlCellTypeBlanks))
If Not r Is Nothing Then
Application.EnableEvents = False
r.Value = Target.Value
Application.EnableEvents = True
End If
Set r = Intersect(Range("H" & Target.Row).Resize(LR - Target.Row + 1, 1), _
Cells.SpecialCells(xlCellTypeBlanks))
If Not r Is Nothing Then
Application.EnableEvents = False
r.Value = d
Application.EnableEvents = True
End If
Set r = Intersect(Range("M" & Target.Row).Resize(LR - Target.Row + 1, 1), _
Cells.SpecialCells(xlCellTypeBlanks))
If Not r Is Nothing Then
Application.EnableEvents = False
r.Value = d
Application.EnableEvents = True
Else
MsgBox "keine weiteren leeren Zellen gefunden"
End If
End If
End If
End If
End If
End If