Gruppe
Ereignis
Problem
Bei Eintragung einer Zahl in Zelle E10 soll automatisch das Datum unter Zugrundelegung des Wertes aus L1 als Jahr und L2 als Monat eingetragen werden.
ClassModule: Tabelle1
Private Sub Worksheet_Change(ByVal Target As Range)
If IsEmpty(Target) Then Exit Sub
If Target.Address = "$E$1" Then
Application.EnableEvents = False
On Error GoTo ERRORHANDLER
Target.Value = DateSerial(Range("B1").Value, _
Range("B2").Value, Target.Value)
End If
ERRORHANDLER:
Application.EnableEvents = True
End Sub