Bonjour à tous
je prépare une macro d'impression un peu particulière.
je veux imprimer des feuilles suivant ce qu'on coche dans un formulaire user form
autrement dis je met des cases à cocher au choix ( case1; case2;case3), (il est possible d'en sélectionner plusieurs) et en fonction de ce qu'on coche bah je choisi mon imprimante ça imprime direct.
je bloque juste sur les conditions ! il me sort "compil error, else without if"
Si quelqu'un peut me sauver de cette situation ....!
Else: If CheckBox1 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Else: If CheckBox1 = True And CheckBox2 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Sheets("Sheet2").PrintOut
Else: If CheckBox1 = True And CheckBox2 = True And CheckBox3 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Sheets("Sheet2").PrintOut
Sheets("Sheet3").PrintOut
Else: If CheckBox1 = True And CheckBox3 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Sheets("Sheet3").PrintOut
Else: If CheckBox2 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet2").PrintOut
Else: If CheckBox3 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet3").PrintOut
End If
Merci bien !
Ben
je prépare une macro d'impression un peu particulière.
je veux imprimer des feuilles suivant ce qu'on coche dans un formulaire user form
autrement dis je met des cases à cocher au choix ( case1; case2;case3), (il est possible d'en sélectionner plusieurs) et en fonction de ce qu'on coche bah je choisi mon imprimante ça imprime direct.
je bloque juste sur les conditions ! il me sort "compil error, else without if"
Si quelqu'un peut me sauver de cette situation ....!
Else: If CheckBox1 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Else: If CheckBox1 = True And CheckBox2 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Sheets("Sheet2").PrintOut
Else: If CheckBox1 = True And CheckBox2 = True And CheckBox3 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Sheets("Sheet2").PrintOut
Sheets("Sheet3").PrintOut
Else: If CheckBox1 = True And CheckBox3 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet1").PrintOut
Sheets("Sheet3").PrintOut
Else: If CheckBox2 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet2").PrintOut
Else: If CheckBox3 = True Then If Application.Dialogs(xlDialogPrinterSetup).Show = False Then Exit Sub
Sheets("Sheet3").PrintOut
End If
Merci bien !
Ben