Select slicer value and print multiple worksheets to one pdf based

Sjajtner

New Member
Joined
Feb 5, 2021
Messages
1
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
  2. Mobile
  3. Web
Hello! I am new to vba and am trying to write a macro that will help me create reports for multiple departments. I have a slicer set up to update all of the worksheets based on that department's data. I then need to print which worksheets are applicable to the department as one pdf.

I have approximately 150 different slicer values/departments that need a report, and there are 8 different printing groups. For example, Group 1 needs Sheet A,B,C, group 2, needs sheet ABCD, Group 3 needs sheets ABD, etc. I have been focusing on having the macro look at a range of values to say if the pages should print or not due to having so many groups. I have also tried listing the groups as a case within the macro and referencing a cell to determine which sheets should be printed for that department. I can't get either to work or am only successful getting one page to print vs all applicable worksheets.

I have searched multiple forums and websites the last few days and cannot get anything to work. :( So far I have been focusing on getting the printing down before I started working on adding in the slicer selection.

In summary, I am looking to:
1. Print specific worksheets to one pdf for multiple groups based on the criteria they meet.
2. Select a slicer value, print, and loop through all slicer values.

Any help with either of these issues would be GREATLY appreciated!!!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,164,121
Messages
5,835,534
Members
430,365
Latest member
JamesAppleby

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