Ouvrir et fermer un UserForm par un bouton

Bonjour a tous, je n'arrive pas a fermer mon UserForm a l'aide du bouton qui a servi a l'ouvrir, est-ce possible?

Private Sub CommandButton4_Click() 'bouton Kpad

If State = False Then
    State = True
    UserForm4.Show

    Else
    State = False
    Unload UserForm4

    End If

End Sub

Bonjour CAPUCIN

Je pense que oui si tu n'ouvres pas ton UsF en mode modal

Private Sub CommandButton4_Click() 'bouton Kpad
  If State = False Then
    State = True
    UserForm4.Show False
  Else
    State = False
    Unload UserForm4  
  End If

End Sub

A+

Salut Bruno! ca marche tres bien, je vais regarde ca de plus pret, le mode "modal"

Bonne journee!

Rechercher des sujets similaires à "ouvrir fermer userform bouton"