Batch Printing With Output Sheet and Table of Values

Onegod007

New Member
Joined
Jun 3, 2015
Messages
2
I am trying to figure out how to write a sub that will let me take a table of values on one tab, cycle those values through the output sheet printing a report for each row and printing all resulting reports to one PDF. At the moment, my code is printing a separate PDF for each line of output. I am using 2010 Excel/VBA but I fear that the code I am about to post below may be from a much older version of excel (maybe 2003). As it stands, the code is written into a sheet and then a macro button is created and references it. Any help would be greatly appreciated.

PSP Rpts
STEP()
=ECHO(FALSE)
=SET.NAME("CNUM",INPUT("Enter number of copies to be printed.",1,"PSP Reports",1,100,100))
=SELECT(!$C$10)
=IF(ISBLANK(ACTIVE.CELL()),GOTO(A13))
=SELECT("R[1]C")
=GOTO(A10)
=SET.NAME("NUM",ROW(ACTIVE.CELL())-10)
=WORKBOOK.SELECT("PSP Output","PSP Output")
=FORMULA.FILL(1,!$T$1)
=IF(NUM>!$T$1,GOTO(A19))
=SELECT(!$A$1:$S$42)
=GOTO(A20)
=SELECT(!$A$1:$S$42)
=SET.PRINT.AREA()
=PRINT(1,1,1,1,FALSE,FALSE,1,FALSE,1)
=SET.NAME("CNT",!$T$1+1)
=IF(CNT>NUM,GOTO(A27))
=FORMULA.FILL(CNT,!$T$1)
=GOTO(A16)
=SET.NAME("CNUM",CNUM-1)
=IF(CNUM>0,GOTO(A15))
=WORKBOOK.SELECT("INPUT","INPUT")
=SELECT(!$A$1)
=RETURN()

<colgroup><col></colgroup><tbody>
</tbody>

The basic functionality is the routine is that it creates an output sheet for each line with values in the "Input" screen. In my particular case, there are 214 lines on the input screen that will produce 214 reports. I would much rather print once to PDF with 214 pages rather than print 214 separate PDF pages that I have to manually name and close out of (since adobe 11 automatically opens the published report). Thanks for any input provided.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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