ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Global Macro (https://www.excelbanter.com/excel-programming/363276-global-macro.html)

addy

Global Macro
 
How can a code a macro which works on ne sheet. By this i mean that it is
accessible from any file you want and not just the one from which it is
created

Norman Jones

Global Macro
 
Hi Addy,

Any macro saved in your Personal.xls workbook will be avialable to all open
workbooks.

If you are recording the macro of interest, in the first dialogbox ("Record
Macro"), select 'Personal Macro Workbook' in the 'Store Macro in' dropdown.

If the Personal.xls file does not already exist, it will be created and
stored in your XLSTART folder.


---
Regards,
Norman


"Addy" wrote in message
...
How can a code a macro which works on ne sheet. By this i mean that it is
accessible from any file you want and not just the one from which it is
created




Nigel

Global Macro
 
One way would be to put your code in a standard module and do not make
explicit references to one particular sheet, by referencing the activesheet
the code will work on the currently active worksheet.

E.g. change references like....... Sheets("Sheet1").Range("A1") to
ActiveSheet.Range("A1") etc....


--
Cheers
Nigel



"Addy" wrote in message
...
How can a code a macro which works on ne sheet. By this i mean that it is
accessible from any file you want and not just the one from which it is
created





All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com