How to print multiple invoices with unique invoice numbers in one click?

pchlopg

New Member
Joined
Apr 10, 2020
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I want to print multiple copies and have a unique invoice number on each page printed in cell P4. I don't want to just send it to the printer as individual print jobs. I would like to send it to print as a pdf in a single 100 page document or if not a pdf then just as a multiple page document.

For example first print run would start at number 1001 and last numbered page is 1100.

I am just a beginner and I have no idea with using developer tools / macro in excel. Step by step instructions would be a great help!

Please help, I will be grateful!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Re: "I want to print multiple copies"
Is that multiple copies of the same sheet or different sheets?

What do you mean by "first print run"?
Does that mean a single PDF file with 100 pages and are these pages 100 different sheets at one page per sheet?

Excel differentiates between pages and sheets.
If you have data in Range("A1:I90") you probably end up with two pages if you column width is the standard width.
But you can print two sheets, Sheet1 & Sheet2 for instance, into a single PDF file
 
Upvote 0
I mean when I exported the excel file into pdf it automatically generates 100 pages with 1 invoice per page and with unique invoice numbers each.

Typing each invoice numbers per sheet is very time consuming and I want to know the easiest way to generate it in just one click.

It is not necessarily has to be pdf.. I just don't know what is the best way I can print invoices that changes the numbers automatically page by page.

Thanks in advance!! :)
 
Upvote 0
Saves the PDF file into the same folder where your excel workbook is stored/saved.
It assumes that the sheets are named by invoice number.
VBA Code:
Sub Maybe_Try()
Dim i As Long, sh As Worksheet
Application.ScreenUpdating = False
Sheets("1000").Select
    For i = 1001 To 1100
        Sheets(i).Select False
    Next i
    For Each sh In ActiveWindow.SelectedSheets
        sh.Range("P4").Value = sh.Name
    Next sh
ActiveSheet.ExportAsFixedFormat xlTypePDF, ThisWorkbook.Path & "\" & "Invoices" & ".pdf"
Sheets("Sheet1").Select
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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