Link to home
Start Free TrialLog in
Avatar of Rayne
RayneFlag for United States of America

asked on

Excel Print Question

Hello All,
I have printing question. Thanks to a previous solution in EE

•      https://www.experts-exchange.com/questions/26980351/Is-it-possible-with-Excel-2010-VBA-to-append-page-print-range-from-sheet-to-existing-pdf.html

Which allows print to PDF in excel.

I have attached the code in the question.


I have two buttons on the worksheets -
1.      Print2SpecificWrkSheets -  adds two worksheets – 1 & 3 into the print job and prints both of them out to the printer
2.      PrintCurrentWorksheetToPDF - The one prints out the active sheets to PDF (awesome code)


Now what I want to accomplish is tell the [PrintCurrentWorksheetToPDF] button to print both the worksheets 1 and 3 to PDF when I press it. In other words – have to Excel to PDF happen for both of those worksheets (1,3)  instead of only worksheet1 or only active sheet.

How can that be done?

Thank you
PrintCode.xlsm
Avatar of Rayne
Rayne
Flag of United States of America image

ASKER

so both the worksheets are printed out to the same PDF document so to speak
In the interim, I'd like you to take a look at one of my blog posts on this subject:
https://www.experts-exchange.com/blogs/dlmille/B_6619-Print-only-certain-sheets-to-PDF-using-ExportAsFixedFormat.html

And the addin that was ultimately created by Kyle (kgerb) - see further down in the blog.

Customizing what you have to do what you want is possible, but it might be later tonite for me to get to it.  However, I hope what I'm posting (above) might suit as an alternative, as well.

Cheers,

Dave
Avatar of Rayne

ASKER

Sure Dave,

Sure I will look at it. No problem. Take your time as you like   :)
ASKER CERTIFIED SOLUTION
Avatar of dlmille
dlmille
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rayne

ASKER

Hello Dave,

Awesome, perfect - that perfectly fits the dimensions that I was looking for. Great help,
Hats off to you  :)