running macro another spreadshee
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Running a Macro from another spreadsheet

Running a Macro from another spreadsheet

resolvedResolved · Medium Priority · Version 2007

replyReplyTue 8 Jun 2010, 15:35Delegate Tom said...

Running a Macro from another spreadsheet

Hi,

How do you open a spreadsheet and run a macro in it from a macro in another spreadsheet without effecting this other spreadsheet?

Thanks,

Tom





For upcoming training course dates see: Pricing & availability

replyReplyWed 9 Jun 2010, 17:17Trainer Stephen said...

RE: Running a Macro from another spreadsheet

Hi Tom

Thanks for your question.

You could open the worksheet from your macro in another worksheet very easily with something like the following

Workbooks(NAME).sheets(Name).activate

You could then run your second macro by calling it in the activate event of that worksheet.

Hope this helps

Regards

Stephen

replyReplyThu 10 Jun 2010, 17:45Delegate Tom said...

RE: Running a Macro from another spreadsheet

Hi Stephen,

Thanks very much for your help. Would you mind explaining a little further. I have tried the following...

Sub RunMacro()

Workbooks("Dist Plan 103a").Sheets("Reforecast").Activate

Application.Run (Workbooks("Dist Plan 103a")!reforecast_figures)

End Sub


Where reforecast_figures is the macro and it doesnt like it, it says Subscript Out of Range.

Sorry about this,

tom

replyReplyMon 14 Jun 2010, 11:39Trainer Stephen said...

RE: Running a Macro from another spreadsheet

Hi Tom

Sorry for the delay in getting back, I have been on a week's leave.

Your first line of code is fine. However your reforcast_figures macro needs to be called from the open event of your "Dist Plan 103a" workbook. Open this workbook and go to the VBE. In the project explorer double click on the workbook object. Above the code window you will have 2 combo boxes. The left most one will probably say "General". Click on the combo and select Workbook. This should then automatically create an on open sub procerdure. In this procedure type
Call reforcast_figures[\code]

This will then run the macro when the workbook opens

Regards

Stephen

Mon 21 Jun 2010: Automatically marked as resolved.

 

 

Please browse our web site to find out more about
application development excel and other Microsoft training courses.

Excel tip:

Some examples of CTRL key shortcuts in Excel 2010

Did you know that the old CTRL key shortcuts haven't changed from previous versions of Excel to the 2010 version?

They remain exactly the same:

Ctrl+B for bold
Ctrl+I for italics
Ctrl+P to Print
Ctrl+S to Save

View all Excel hints and tips

forum postAfter creating a flow chart of the structure of the presentation, how do I get it to appear within each sheet without copying and pasting each time.

The intention is that the current sheet that you are looking at will highlight the relevant section in ..

» Forum post: Presentation structure/flow chart


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

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

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training