1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Option Explicit
Private Sub CommandButton1_Click()
Me.Hide 'CommandeButton1 c'est le bouton Annuler. Ici Me represente le formulaire. On demande que le formulaire soit caché.
End Sub
Private Sub CommandButton2_Click() 'C'est le bouton OK
If OptionButton1.Value = True Then 'Teste si l'option1 est choisi alors...
Workbooks.Open Filename:="C:\Users\RastaBomboclat\Desktop\fichierexp5L.xls " 'Ouvre la feuil fichierexp5L
ElseIf OptionButton2.Value = True Then
Workbooks.Open Filename:="C:\Users\RastaBomboclat\Desktop\fichierexp5L.xls " 'Ouvre la feuil fichierexp20L
ElseIf OptionButton3.Value = True Then
Workbooks.Open Filename:="C:\Users\RastaBomboclat\Desktop\fichierexp5L.xls " 'Ouvre la feuil fichierexp1000L
Else: MsgBox Application.UserName & "," & vbCr & "Il faut faire un choix!", vbInformation, "Pas de choix fait" 'Au cas contraire un message est afficher demandant de faire un choix
End If
End Sub |
Partager