?
Solved

Apply page setup on multiple excel files

Posted on 2011-09-13
3
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
grogman earned 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 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