Forum Discussion
girlfromkent
Jan 07, 2025Copper Contributor
Excel order number macro to print duplex
Hi All I have an order form as an excel sheet with a simple macro that increases the order number by one and prints it onto the sheet. Sub PrintCopiesWithNumbers2() 'UpdatebyEntendoffice20161031 ...
NikolinoDE
Jan 08, 2025Gold Contributor
If your printer supports duplex printing, you can force duplex mode using the ActivePrinter property along with PrintOut.
Sub PrintCopiesWithNumbers2()
Dim i As Integer
Dim DuplexMode As Long
Application.ScreenUpdating = False
' Set Duplex Mode (1 = Simplex, 2 = Vertical Duplex, 3 = Horizontal Duplex)
DuplexMode = 2 ' Change to 3 if your printer requires horizontal duplex
For i = 850 To 875
' Update the order number
Range("D45").Value = "'00" & i
' Print with duplex setting
ActiveSheet.PageSetup.CenterHeader = "Order No: " & Range("D45").Value
ActiveSheet.PrintOut Copies:=1, Collate:=True, ActivePrinter:=Application.ActivePrinter, _
PrintToFile:=False, PrToFileName:="", IgnorePrintAreas:=False
Next i
Application.ScreenUpdating = True
MsgBox "Printing Complete"
End Sub
I hope I was able to help you with this.