1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Private DernierBouton as String
Private Sub CommandButton1_Click()
DernierBouton="Bouton1"
End Sub
Private Sub CommandButton2_Click()
DernierBouton="Bouton2"
End Sub
Private Sub CommandButton3_Click()
Load UserForm2
If DernierBouton="Bouton1" Then
UserForm2.Frame1.Visible=True
UserForm2.Frame2.Visible=False
ElseIf DernierBouton="Bouton2" Then
UserForm2.Frame1.Visible=False
UserForm2.Frame2.Visible=True
Else
'Gérer ici le cas où l'utilisateur n'a appuyé sur aucun des 2 CommandButton
'Si UserForm2 ne doit pas être affiché dans ce cas, ajouter les deux instructions suivantes :
'Unload UserForm2
'Exit Sub
End If
UserForm2.Show
End Sub |
Partager