Hallo,
momentan steht der errechnete wert über dem kontrollkästchen.was muß ich im code ändern damit der wert links neben dem kästchen angezeigt wird??
Sub tt()
With ActiveSheet.Shapes(Application.Caller)
If .ControlFormat.Value = -4146 Then Exit Sub
.TopLeftCell.Value = DateSerial(Year(.TopLeftCell.Value) + 1, _
Month(.TopLeftCell.Value), Day(.TopLeftCell.Value))
.ControlFormat.Value = -4146
End With
gruß
thw
Hallo Tobias,
dass der Wert scheinbar oberhalb der Checkbox angezeigt wird liegt wohl daran, dass die linke, obere Ecke des Checkbox-Rahmens diese Zelle unten noch berührt.
Durch zusätzlich Offset-Anweisungen im Code kannst du angaben wo das Ergebnis relativ zur LeftTop-Cell der Checkbox eingetragen werden soll.
Gruß
Franz
Sub tt()
With ActiveSheet.Shapes(Application.Caller)
If .ControlFormat.Value = -4146 Then Exit Sub
.TopLeftCell.Offset(-1, -1).Value = DateSerial(Year(.TopLeftCell.Offset(-1, -1).Value) + 1, \_
Month(.TopLeftCell.Offset(-1, -1).Value), Day(.TopLeftCell.Offset(-1, -1).Value))
.ControlFormat.Value = -4146
End With
End Sub