vba courses london - running procedure multiple workb
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Running a procedure for multiple workbooks.

vba courses london - Running a procedure for multiple workbooks.

The UK's most regular instructor-led training courses.
Training information: vba courses london · Excel london

resolvedResolved · Low Priority · Version Standard

Running a procedure for multiple workbooks.

Ben has attended:
Excel VBA course

by - delegate Ben [1 post] (2007 Apr 17 Tue, 08:51) replyReply

Dear Sir/Madam

How do you run a procedure for multiple workbooks in different locations/folders?

i.e. we need to change a specific cell in 40 different excel spreadsheets all located in different folders. This cell has to increase in number by one every financial period.

Kind Regards,

Ben

RE: Running a procedure for multiple workbooks.

by - trainer Carlos gold contributer[413 posts] (2007 Apr 19 Thu, 09:52) replyReply

Ben

The computer needs to load the workbook into the system, then change the relevant cells and close

To do this

Workbooks.Open Filename:= The full path of the workbook eg. "c:\My Docs\book1.xls"

Then write the code to go in and change the relevant cell

Activeworkbook.Save
Activeworkbook.Close


If you want you can use a list of all the Workbook paths. Then create a variable eg.

Dim MyWorkbook as String

With which you replace filename path above.

Create a loop that loads each new Workbook name into the variable and then runs the above code.

Regards

Carlos

RE: Running a procedure for multiple workbooks.

by - trainer Roy [23 posts] (2007 Apr 20 Fri, 14:28) replyReply

I wonder whether it wouldn't be easier to have a handler for the Workbook.Open event, which checks the current date (Date function), calculates the appropriate financial period, and updates the cell accordingly.

/Roy


Related articles

· What Is Microsoft Excel VBA and How Can It Help You Work Smarter?
· Company Roles in Visual Basic Training

Vba tip:

Add A New Sheet at the end of the Workbook

To add a new sheet at the end of the workbook you need to count the sheets in the workbook using:

Sheets.Count

Then use this value as the rank of the sheet after which you want to add the new sheet:

Sheets.Add After:=Sheets(Sheets.Count)

View all VBA hints and tips

Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz