Private Sub TbxValeurLibre_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 44 If InStr(TbxValeurLibre.Text, ",") Then KeyAscii = 0 Case 48 To 57 Case Else KeyAscii = 0 End Select End Sub
Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire
200 internautes nous ont dit merci ce mois-ci
Private Sub TbxValeurLibre_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 44 If InStr(TbxValeurLibre.Text, ",") Then KeyAscii = 0 Case 48 To 57 Case Else KeyAscii = 127 End Select End Sub
Sub TbxValeurLibre_KeyPress(ByVal KeyAscii As USForms.ReturnInteger)
Select Case KeyAscii
case 8
Case 44
If InStr(TbxValeurLibre.Text, ",") Then KeyAscii = 0
Case 48 To 57
Case Else : KeyAscii = 0
End Select
End Sub
Case 8, 48 To 57
Private Sub TextBox1_Change() Static anc As String If Not IsNumeric(TextBox1.Text) Or UCase(TextBox1) Like "*[A-Z]*" Then TextBox1.Text = anc: beep Else anc = TextBox1 End If End Sub