Printing invoices in original, duplicate, triplicate in excel

ABU_HASAN

New Member
Joined
Jun 27, 2017
Messages
16
Dear All

I use the following VBA code to print Invoices using a confirmation box on excel
Sub Print1()
Dim Answer As VbMsgBoxResult
Answer = MsgBox("CONFIRM", vbYesNo, "Run Macro")
If Answer = vbYes Then
ActiveSheet.PrintOut Copies:=2, Collate:=True
End If
End Sub

I want to print 3 copies i.e. "(ORIGINAL FOR RECIPIENT)" , "(DUPLICATE FOR TRANSPORTER)" and "(TRIPLICATE FOR SUPPLIER)" showing on the right hand corner of Invoices
Please note I dont need to print DUPLICATE all the time so I want a choice in the confirmation box to confirm to print Duplicate othewise print Original and Triplicate

Kindly Help

Regards
ABU
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
hmmm. A loop where the Header and/or Footer are changed for the printing. It could also be like a watermark, but I think solid text would be better if your customer scans any of the documents.

Maybe something like:
Code:
Sub Macro26()'
' Macro26 Macro
'
Dim FirstPrint As String, SecPrint As String, ThirdPrint As String


FirstPrint = "(ORIGINAL FOR RECIPIENT)"
SecPrint = "(DUPLICATE FOR TRANSPORTER)"
ThirdPrint = "(TRIPLICATE FOR SUPPLIER)"
'
    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .CenterHeader = FirstPrint
        .CenterFooter = FirstPrint
    End With
    
    Application.PrintCommunication = True
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
    Application.PrintCommunication = False
    
    With ActiveSheet.PageSetup
        .CenterHeader = SecPrint
        .CenterFooter = SecPrint
    End With
    Application.PrintCommunication = True
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
    Application.PrintCommunication = False


    With ActiveSheet.PageSetup
        .LeftHeader = ""
        .CenterHeader = ThirdPrint
        .CenterFooter = ThirdPrint
    End With
    Application.PrintCommunication = True
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
    End Sub

Uses the QuickPrint method, so your pages must be set and your printer defined.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top