Creating Global excel macros

  • Thread starter Thread starter Sebastian_var
  • Start date Start date
S

Sebastian_var

Hi,
I need to create a macro which could be used for all excel sheets.
Is this possible.
Thanks..
 
Yes, it is possible, just place it in personal.xls as a module and it will
be visible from all of the worksheets.
Tomek
 
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
 
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
 
Back
Top