Deze kan je ook nog proberen.
Private Sub txtTijd_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox "Hopla! Weer mis.", vbOKOnly, "Geen cijfer."
KeyAscii = vbNull
End If
End Sub
Private Sub txtTijd_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Dim xHour As String
Dim xMinute As String
Dim xWord As String
If txtTijd.Text = "" Then Exit Sub
xWord = Format(txtTijd.Text, "0000")
xHour = Left(xWord, 2)
xMinute = Right(xWord, 2)
txtTijd.Text = TimeSerial(0, xHour, xMinute)
End Sub