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 27 28 29 30 31 32 33 34 35 36 37
| Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Imprimer.Hide
'Nombre d'impression en duplicata
Range("T1").Value = Imprimer.ComboBox1.Value
'Nombre d'impression en original
Range("T2").Value = Imprimer.ComboBox2.Value
If Imprimer.ComboBox1.Value <> "" Then
Range("Page1").Select
Range("m5") = "[Duplicata]"
Application.ActivePrinter = "\\gresrvr01\GRE_HP_4350_59A sur Ne02:"
Selection.PrintOut Copies:=[T1], Collate:=True
End If
'Si il y a une 2ème page à imprimer en duplicata
If Range("F131") <> "" Then
Range("Page2").Select
Range("m5") = "[Duplicata]"
Application.ActivePrinter = "\\gresrvr01\GRE_HP_4350_59A sur Ne02:"
Selection.PrintOut Copies:=[T1], Collate:=True
End If
If Imprimer.ComboBox2.Value = "" Then
Range("T2") = ""
ElseIf ComboBox2.Value <> "" Then
Range("M5") = "[Original]"
Range("Page1").Select
Application.ActivePrinter = "\\gresrvr01\GRE_HP_4350_59A sur Ne02:"
Selection.PrintOut Copies:=[T2], Collate:=True
'Si 2ème page à imprimer en original
If Range("F131") <> "" Then
Range("M5") = "[Original]"
Range("Page2").Select
Application.ActivePrinter = "\\gresrvr01\GRE_HP_4350_59A sur Ne02:"
Selection.PrintOut Copies:=[T2], Collate:=True
End If
End If
Range("A3").Select
End Sub |