Filter, print as pdf, save to folder according to cell values

Lux Aeterna

Board Regular
Joined
Aug 27, 2015
Messages
201
Office Version
  1. 2019
Platform
  1. Windows
Hello everyone!

I have got an excel file that looks something like this

idpendingnameplace
1YesJohnAthens
2NoJillLondon
3NoJakeBerlin
4YesJacobManhattan

What I'd like is a macro that filters places and create separate PDFs for each place. Then I need each PDF to be saved to a different folder according to two cell values.

The list of places is in column G (starting in G5, ending in G10033). Some cells are blank and one cell is named stop. They can be skipped.

Save folder is "C:\Users\pc50\Desktop\New results\Place_value\D3_value\

Name of the PDF file can be "Place_value - List D3_value", which would be something like "Athens - List 2023".

Print area for the whole sheet, in case needed, is A1 to G10033, but I guess it will be automatically adjusted after the place is filtered, from A1 to Gxxx.

Thank you in advance! 🙏
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Forgot to mention

Also check if folder exists and create if not.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,150
Members
452,615
Latest member
bogeys2birdies

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