macros

M

Marie-Therese

how do i create a macro in excel to run other macros in different excel
workbooks?
 
M

mr_ben

In tools options under the general tab there's a secrtion called
Alternative startup file location.

set that to (for example) c:\my documents


Then....

create a new work book
and then save it into that directory and call it "macros.xls",


Create a new macro when it asks for it's storage location (dependant on
how you create a macro) save is into the spreadsheet you've just created
(ie macros.xls).

once done resave it *but* before you do save it hide the workbook
(window - hide).


This way everytime you open a new (or existing) spreadsheet the
macro(s) will available to you.


When you need to add or change a macro to the "macros.xls" spreadsheet
you'll need to unhide it, amke the necessary changes, re-hide and
save.


HTH, if you need to have anything more clearly explained please ask


Mr_Ben
 
D

Dave Peterson

Option Explicit
Sub testme02()
Dim OtherWkbk As Workbook
Set OtherWkbk = Workbooks("book1.xls")
Application.Run "'" & OtherWkbk.Name & "'!macronamehere"
End Sub
 
Top