Modification dans UserForm

Résolu
mic6259 Messages postés 343 Date d'inscription   Statut Membre Dernière intervention   -  
mic6259 Messages postés 343 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour a tous
Suivant la pièce jointe, pourriez vous modifier de façon a, plutôt que de cliquer sur les CommanButtons dans UserForm les remplacer par mon clavier numérique. Puis remplacer "Valider Payant" par la touche v sur mon clavier et "Valider GRATUIT" par g, aussi "ENREGISTRER la commande" par la touche e. Pour travailler plus vite, avec la souris çà prends un peut plus de temps. Pour le reste çà ira.
Je vous remercie beaucoup
Cordialement
https://cjoint.com/c/HLijligmWS8

1 réponse

  1. cs_Le Pivert Messages postés 8437 Statut Contributeur 730
     
    Bonjour,

    Ajouter une TextBox et mettre ce code:

    Private Sub TextBox5_Change()
    Dim texte As String
    texte = TextBox5.Text
    Select Case texte
    Case Is = "1"
    Call CommandButton1_Click
    Case Is = "2"
    Call CommandButton2_Click
    Case Is = "3"
    Call CommandButton3_Click
    Case Is = "4"
    Call CommandButton4_Click
    Case Is = "5"
    Call CommandButton5_Click
    Case Is = "6"
    Call CommandButton6_Click
    Case Is = "7"
    Call CommandButton7_Click
    Case Is = "8"
    Call CommandButton8_Click
    Case Is = "9"
    Call CommandButton9_Click
    Case Is = "v"
    Call CommandButton23_Click
    Case Is = "e"
    Call CommandButton20_Click
     Case Else
    'MsgBox "Aucun raccourci clavier", vbCritical, "Raccourci clavier"
    End Select
    TextBox5.SetFocus
    TextBox5.Text = ""
    End Sub
    Private Sub UserForm_Activate()
     TextBox5.SetFocus
    End Sub
    Private Sub userForm_Initialize()
    With Me
            .startUpPosition = 3
            .Left = Application.Width - Me.Width
        End With
    End Sub
    


    Voilà

    @+ Le Pivert
    0
    1. mic6259 Messages postés 343 Date d'inscription   Statut Membre Dernière intervention   1
       
      Merci beaucoup Le Pivert
      Çà fonctionne très bien, mais le seul soucis c'est qu'il faut rester sur le TextBox5, car je navigue dans les autres CommandButtons.
      Mais çà va quand même a mois qu'il y a une autre solution?
      Cordialement
      0