Private Sub Worksheet_Change(ByVal Target As Range)
[COLOR="SeaGreen"]'aide saisie heures d'après une macro de Wilfried42[/COLOR]
If Not Intersect(Target, Range("A1")) Is Nothing Then [COLOR="SeaGreen"]'plage à adapter[/COLOR]
On Error Resume Next
If Not IsNumeric(Target) Or Int(Target) > 60 Or Target - Int(Target) > 60 Then
MsgBox "erreur de saisie"
Exit Sub
Else
Dim tps As Single
tps = Target.Value * 100
Application.EnableEvents = Not Application.EnableEvents
Target = Format(CDate("00:" & CStr(Int(tps / 100)) & ":" & CStr(tps Mod 100)), "[$-F400]h:mm:ss AM/PM")
Application.EnableEvents = Not Application.EnableEvents
End If
End If
End Sub