Solved

Apply page setup on multiple excel files

Posted on 2011-09-13
3
197 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

832 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