Je souhaiterais que le format encodé dans un textbox soit 10h15 (c-a-d 2
chiffres, h, 2 chiffres) si ce n'est pas ce format je fais apparaitre un
msgbox. comment puis-je faire pour qu'il vérifie ce type de format
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
AV
Private Sub CommandButton1_Click() x = TextBox1.Text t1 = IsNumeric(Left(x, 2)) t2 = Mid(x, 3, 1) = "h" t3 = IsNumeric(Right(x, 2)) t4 = Len(x) = 5 If t1 + t2 + t3 + t4 <> -4 Then MsgBox "Ca va pas !" End Sub
AV
Private Sub CommandButton1_Click()
x = TextBox1.Text
t1 = IsNumeric(Left(x, 2))
t2 = Mid(x, 3, 1) = "h"
t3 = IsNumeric(Right(x, 2))
t4 = Len(x) = 5
If t1 + t2 + t3 + t4 <> -4 Then MsgBox "Ca va pas !"
End Sub
Private Sub CommandButton1_Click() x = TextBox1.Text t1 = IsNumeric(Left(x, 2)) t2 = Mid(x, 3, 1) = "h" t3 = IsNumeric(Right(x, 2)) t4 = Len(x) = 5 If t1 + t2 + t3 + t4 <> -4 Then MsgBox "Ca va pas !" End Sub