Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
I have created a macro that I need to use whenever I import a text file. However, the macro is only associated with the file that I wrote it in. How do I make it available to any file I have open? As of now, I have to go find the original file I wrote the macro for and copy/paste the code into the current workbook. I know there has to be a better way. Any help is much appreciated. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hard to say without seeing the macro, but in general, if you use
activcecell, activesheet, activeworkbook rather than specific names for these, it should work with the current workbook/sheet/cell. -- Regards, Tom Ogilvy "Trevor" wrote in message ... Hello All, I have created a macro that I need to use whenever I import a text file. However, the macro is only associated with the file that I wrote it in. How do I make it available to any file I have open? As of now, I have to go find the original file I wrote the macro for and copy/paste the code into the current workbook. I know there has to be a better way. Any help is much appreciated. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
That's good info, thank you. But once I do that, how do I access that macro when I open a new workbook? Thanks for your help. Trevor -----Original Message----- hard to say without seeing the macro, but in general, if you use activcecell, activesheet, activeworkbook rather than specific names for these, it should work with the current workbook/sheet/cell. -- Regards, Tom Ogilvy "Trevor" wrote in message ... Hello All, I have created a macro that I need to use whenever I import a text file. However, the macro is only associated with the file that I wrote it in. How do I make it available to any file I have open? As of now, I have to go find the original file I wrote the macro for and copy/paste the code into the current workbook. I know there has to be a better way. Any help is much appreciated. Thanks. . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, the macro has to be in an open workbook, so I would use a single
workbook to store my macros and open it when I need it or put it in the xlstart directory and it will be opened whenever the workbook is opened. There special provision made for such a workbook - the personal.xls workbook. If you record a macro, excel offers to store the macro in personal workbook. If you select this option and it doesn't exist, it is created. If it already exists, the macro is stored there. this workbook is opened whenever excel is opened (manually) and is marked as hidden so it doesn't appear in excel. This is where most people place macros they want to use as you describe. -- Regards, Tom Ogilvy wrote in message ... Tom, That's good info, thank you. But once I do that, how do I access that macro when I open a new workbook? Thanks for your help. Trevor -----Original Message----- hard to say without seeing the macro, but in general, if you use activcecell, activesheet, activeworkbook rather than specific names for these, it should work with the current workbook/sheet/cell. -- Regards, Tom Ogilvy "Trevor" wrote in message ... Hello All, I have created a macro that I need to use whenever I import a text file. However, the macro is only associated with the file that I wrote it in. How do I make it available to any file I have open? As of now, I have to go find the original file I wrote the macro for and copy/paste the code into the current workbook. I know there has to be a better way. Any help is much appreciated. Thanks. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax error while applying a formula in a macro | Excel Discussion (Misc queries) | |||
Applying a macro to a command button, Excel 2002 | Excel Discussion (Misc queries) | |||
Applying a macro to all worksheets | Excel Discussion (Misc queries) | |||
Applying same macro to all worksheets in workbook | Excel Discussion (Misc queries) | |||
Macro in all workbooks | Excel Discussion (Misc queries) |