I'm facing a complicated (to me) issue in printing a worksheet via VBA. The ranges I'd like to print are:
A1:Q63 to PDF page 1
A1:B12 & A65:AK74 to PDF page 2
A1:B12 & A76:AC125 to PDF page 3
*Unfortunately, I cannot upload images from my work laptop.
**I could get rid of A1:B12 on pages 2 & 3 if I figure out how to update each page's header and/or footer with cell values. I haven't looked into this yet.
My immediate questions are:
1. I assume I need to declare each of those 4 different ranges as such; allowing me to use the range name to set print areas. Is this accurate?
2. I would like to adjust the column width of certain columns when printing that range. Example: On page 1, I'd like to adjust the width of columns P & Q to 7, then back to 18 when printing page 3. I assume the code's flow would be something like Set Ranges --> Adjust Formatting --> Set Print Areas --> Print PDF sheet 1 --> Clear Print Areas --> Adjust Formatting --> Set Print Areas --> Print PDF sheet 2 --> Clear Print Areas --> Adjust Formatting --> Set Print Areas --> Print PDF sheet 3 --> Clear Print Areas. I'm struggling to find something on the web that shows how to print all 3 pages outlined above, into a single PDF document. Any suggested links that can help me achieve my goals?
A1:Q63 to PDF page 1
A1:B12 & A65:AK74 to PDF page 2
A1:B12 & A76:AC125 to PDF page 3
*Unfortunately, I cannot upload images from my work laptop.
**I could get rid of A1:B12 on pages 2 & 3 if I figure out how to update each page's header and/or footer with cell values. I haven't looked into this yet.
My immediate questions are:
1. I assume I need to declare each of those 4 different ranges as such; allowing me to use the range name to set print areas. Is this accurate?
2. I would like to adjust the column width of certain columns when printing that range. Example: On page 1, I'd like to adjust the width of columns P & Q to 7, then back to 18 when printing page 3. I assume the code's flow would be something like Set Ranges --> Adjust Formatting --> Set Print Areas --> Print PDF sheet 1 --> Clear Print Areas --> Adjust Formatting --> Set Print Areas --> Print PDF sheet 2 --> Clear Print Areas --> Adjust Formatting --> Set Print Areas --> Print PDF sheet 3 --> Clear Print Areas. I'm struggling to find something on the web that shows how to print all 3 pages outlined above, into a single PDF document. Any suggested links that can help me achieve my goals?