Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Applying Macro to all workbooks...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Applying Macro to all workbooks...

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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Applying Macro to all workbooks...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Applying Macro to all workbooks...

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error while applying a formula in a macro pol Excel Discussion (Misc queries) 3 December 1st 08 07:21 PM
Applying a macro to a command button, Excel 2002 Vicky Excel Discussion (Misc queries) 3 March 25th 08 07:05 PM
Applying a macro to all worksheets DannyS Excel Discussion (Misc queries) 7 January 15th 07 05:21 PM
Applying same macro to all worksheets in workbook [email protected] Excel Discussion (Misc queries) 2 October 19th 05 11:25 PM
Macro in all workbooks Pam Coleman Excel Discussion (Misc queries) 2 February 24th 05 07:49 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"