Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 487
Default creating macro that works in any open workbook?

I can setup and record macros without a problem normally. But I can't figure
out how to setup one that will work no matter what file I have open. I just
need it to copy a few different areas to a known template, but the sheet
being copied will always be a different file. The marco I've setup always
has an error because it looks for the same file that I originally created the
macro to copy from. Can anyone help out on this??? I know it has to be a
simple fix, I'm just over thinking it!!! Thanks for the help in advance......
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default creating macro that works in any open workbook?

save the file in Excel's startup or alternative startup folders, so that
Excel will open it as soon as you launch Excel
"Don" wrote in message
...
I can setup and record macros without a problem normally. But I can't
figure
out how to setup one that will work no matter what file I have open. I
just
need it to copy a few different areas to a known template, but the sheet
being copied will always be a different file. The marco I've setup always
has an error because it looks for the same file that I originally created
the
macro to copy from. Can anyone help out on this??? I know it has to be a
simple fix, I'm just over thinking it!!! Thanks for the help in
advance......


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default creating macro that works in any open workbook?

This site has some info that might help.

http://personal-computer-tutor.com/personalxls.htm


"Don" wrote in message
...
I can setup and record macros without a problem normally. But I can't
figure
out how to setup one that will work no matter what file I have open. I
just
need it to copy a few different areas to a known template, but the sheet
being copied will always be a different file. The marco I've setup always
has an error because it looks for the same file that I originally created
the
macro to copy from. Can anyone help out on this??? I know it has to be a
simple fix, I'm just over thinking it!!! Thanks for the help in
advance......



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default creating macro that works in any open workbook?

Store the macro in your Personal.xls(b) file.

In the macro make sure you use "activeworkbook" and/or "activesheet" not a
hard-coded file/sheet name.


Gord Dibben MS Excel MVP

On Tue, 19 May 2009 07:44:09 -0700, Don
wrote:

I can setup and record macros without a problem normally. But I can't figure
out how to setup one that will work no matter what file I have open. I just
need it to copy a few different areas to a known template, but the sheet
being copied will always be a different file. The marco I've setup always
has an error because it looks for the same file that I originally created the
macro to copy from. Can anyone help out on this??? I know it has to be a
simple fix, I'm just over thinking it!!! Thanks for the help in advance......


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
Excel workbook wants to open with Works garwein Excel Discussion (Misc queries) 1 October 5th 09 01:35 AM
Excel Addin works that works on a template workbook s.jay_k Excel Programming 0 February 15th 06 07:31 PM
Macro works in one workbook but not in another sungen99[_42_] Excel Programming 6 January 26th 06 06:25 PM
Runtime error for macro that works in workbook created in Crystal Excel Discussion (Misc queries) 1 June 22nd 05 08:43 PM
Creating Menu to open workbook kwatch Excel Worksheet Functions 1 April 14th 05 06:54 PM


All times are GMT +1. The time now is 05:06 PM.

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

About Us

"It's about Microsoft Excel"