Macro to print selected visible sheets

JessicaKinnear

New Member
Joined
Jan 6, 2021
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hey,

I'm looking for some help in running a macro to print to PDF only certain visible sheets.

I've got an excel workbook that depending on a number that is entered into a cell (numbers 1 - 40), it will populate the corresponding sheets. For example if someone puts 12 into the cell C32 on my 'inputs' tab, 12 sheets will be populated with the name 'tenant-1', tenant-2' etc. There are about 10 other sheets in my document that are always visible but I would like to run a macro so it only prints the sheets named cover, intro, budget, apportionment, contacts, along with the tenant tabs that have been populated, so in my example this would be an extra 12 sheets named 'tenant - 1', tenant-2' up to 12. However this could be anything from one tenant tab up to 40.

Is it possible to run a macro to do this?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,125
Messages
5,768,259
Members
425,460
Latest member
Astros1243

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
Top