Solved

Apply page setup on multiple excel files

Posted on 2011-09-13
3
194 Views
Last Modified: 2012-06-22
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?
0
Comment
Question by:coronoahcoro
3 Comments
 
LVL 4

Accepted Solution

by:
grogman earned 500 total points
ID: 36530248
Simplest method I can think of (if you don't have much experience writing/modifying VBA code) would be to record a macro, store it in Personal Macro Workbook so it will be available regardless of open file, and while recording, set your page setup preferences exactly how you want them for the first file. Stop recording, then open each of the other files and run the recorded macro against them one at a time, saving changes to each file. This will automate the process of applying all of your settings. Granted, you will still need to open and save each file, but getting your page setup options applied will only take a couple of clicks.
0
 
LVL 2

Author Comment

by:coronoahcoro
ID: 36530299
I have some experience with modifying VBA code. What would be the best way with VBA code?
0
 
LVL 4

Expert Comment

by:SafetyFish
ID: 36530374
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 :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now