
A jinak:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rdW As Long, slW As Byte
slW = Target.Column
'kdyz sloupec dat = 1
If slW = 1 Then
Application.EnableEvents = False
'kdyby bylo vice radku
For rdW = Target.Row To Target.Row + Target.Rows.Count - 1
'je prazdna nebo neni cislo
If IsEmpty(Cells(rdW, slW)) Or Not IsNumeric(Cells(rdW, slW)) Then
MsgBox "Nepovolena hodnota !"
Range(Cells(rdW, slW + 1), Cells(rdW, slW + 2)).ClearContents
Else
'vlozi aktualni datum
Cells(rdW, slW + 1) = Date
'vlozi aktualni datum i cas
Cells(rdW, slW + 2) = Now
End If
Next rdW
Application.EnableEvents = True
End If
End Sub