Creating Global excel macros

S

Sebastian_var

Hi,
I need to create a macro which could be used for all excel sheets.
Is this possible.
Thanks..
 
T

Tomek

Yes, it is possible, just place it in personal.xls as a module and it will
be visible from all of the worksheets.
Tomek
 
B

Bob Phillips

If you want to run it from VBA, the format is

Application.Run "'Personal.xls'!Test"

If the macro has arguments, you use

Application.Run "'Personal.xls'!Test", "Goodbye"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Tomek said:
Yes, it is possible, just place it in personal.xls as a module and it will
be visible from all of the worksheets.
Tomek
 
G

Gord Dibben

Sebastian

In addition to storing in the Personal.xls workbook, make sure the code does
not refer to hard-coded items such as worksheet names, workbook names, cell
references etc.

Use relative references as Offset, Activecell, Activesheet.

If recording the macros, toggle the "Relative Reference" button to "ON"

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top