Re : Activation de userforms par combobox
Bonsoir Azerty et à tous les lecteurs.
Vois si cela t'inspire.
😉Ca marche super merci
Une autre question, j'ai crée un userform d'impression avec choix imprimantes.
Le prob c'est quand je veux annuler par la fenêtre "choix imprimante", l'impression se lance quand même ??
code:
Private Sub TextBox1_Change()
End Sub
Private Sub CommandButton1_Click()
Me.Hide
End Sub
Private Sub Imprimer_Click()
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Label2_Click()
End Sub
Private Sub CheckBox1_Click()
Sheets("Natzwiller").Select
End Sub
Private Sub CheckBox2_Click()
Sheets("Espagne").Select
End Sub
Private Sub CheckBox3_Click()
Sheets("Suisse").Select
End Sub
Private Sub CheckBox4_Click()
Sheets("Paris").Select
End Sub
Private Sub CheckBox5_Click()
Sheets("Allemagne").Select
End Sub
Private Sub CheckBox6_Click()
Sheets("Personnel entreprise").Select
End Sub
Private Sub CheckBox7_Click()
Me.PrintOut
End Sub
Private Sub Imprimer1_Click()
Dim DefaultPrinter As String, ChoixPrinter As String
'
DefaultPrinter = Application.ActivePrinter
'
''Affiche une fenêtre de choix d'imprimante
Application.Dialogs(xlDialogPrinterSetup).Show
'
''Imprime la feuille active
''ActiveSheet.printout
'
''remet l'imprimante par défaut
'Application.ActivePrinter = DefaultPrinter
On Error Resume Next
Application.ScreenUpdating = False
Dim i As Integer
Unload Me
For i = 1 To 6
If Controls("CheckBox" & i) = True Then Sheets(Controls("Label" & i).Caption).PrintOut
'PrintOut
Next
End Sub
Private Sub UserForm_Click()
End Sub
Merci encore
😉