Link to home
Start Free TrialLog in
Avatar of coronoahcoro
coronoahcoroFlag for United States of America

asked on

Apply page setup on multiple excel files

I have around 50 excel files and I want to change the page setup on all the files to have the same settings (Page margin, page orientation, column width, row width, etc).

What would be the best way to change the page setup on all files without manually change each file at a time?
ASKER CERTIFIED SOLUTION
Avatar of grogman
grogman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coronoahcoro

ASKER

I have some experience with modifying VBA code. What would be the best way with VBA code?
If, for instance, all the files are in a single folder you can write a loop to loop through all the files in the folder, check their extension for a .xls or .xlsm, etc, open them, apply the page setup settings change, save and close them again.

The only tricky part of this is getting the file location strings right, but that is generally not so hard.

http://vbatutor.blogspot.com/2009/02/excel-vba-macro-example-opening-closing.html

http://excelexperts.com/VBA-Tips-List-Files-In-A-Folder

Those should get you started :)