Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("S1") Then
If IsEmpty(Range("D2")) Then
Range("D2:D1000").NumberFormat = Target.Value & "-00-0000"
Else
Range(Range("D2").End(xlDown)(2), Range("D1000")).NumberFormat = Target.Value & "-00-0000"
End If
End If
End Sub
Pro stavajici data zustane format zachovan a novy se nastavi od prvni prazdne bunky do D1000.
sydcitovat