VBA to Refresh, Select Multiple Sheets, & Print To PDFs

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
351
Office Version
  1. 2019
Platform
  1. Windows
Hello!

I have a workbook with 30-ish sheets, of which I would like to have code which will ultimately print (to PDF) the same 10 sheets each day, after completing a couple of other tasks as well.
Specifically, this is what I need it to do:

1) "Refresh All" queries, data model, and pivot tables in the workbook (Workbook name: "Workbook1".
2) Select & print 13 sheets to PDF. (These will be the same sheets each day & the sheet names never change, unless I happen to add more at some time in the future).
To save keystrokes here, let's just say it's 3 sheets, which are called "Sheet1", "Sheet2", "Sheet3".
I would like the names to be a combination of the sheet name and today's date. So today, they would be called "Sheet1 7/4/2021",etc.
3) Resave workbook.

Thanks.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This thread can be deleted. I figured it out, but I'm also changing the way I'm doing it So I'll likely ask some different questions in another thread.
 
Upvote 0

Forum statistics

Threads
1,215,544
Messages
6,125,444
Members
449,226
Latest member
Zimcho

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