Bonjour a tous,
je viens vers vous pour avoir une a niveau au niveau de mon code.
je voudrais forcer la saisie numerique dans toutes les textbox de mon USF. j'ai reussi mais je trouve le code long et je pense qu'il y a un moyen de faire plus cours.
on est d'accord obligé il y a plus simple 😛
Cordialement
Pex
je viens vers vous pour avoir une a niveau au niveau de mon code.
je voudrais forcer la saisie numerique dans toutes les textbox de mon USF. j'ai reussi mais je trouve le code long et je pense qu'il y a un moyen de faire plus cours.
Code:
Private Sub textbox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub textbox3_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub textbox4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub textbox5_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub textbox6_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub textbox7_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub tbmontee_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub tbdescente_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub tbmontee2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
Private Sub tbmontee3_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("1234567890,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub
on est d'accord obligé il y a plus simple 😛
Cordialement
Pex