PC Review


Reply
Thread Tools Rate Thread

creating macro that works in any open workbook?

 
 
Don
Guest
Posts: n/a
 
      19th May 2009
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 With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      19th May 2009
save the file in Excel's startup or alternative startup folders, so that
Excel will open it as soon as you launch Excel
"Don" <(E-Mail Removed)> wrote in message
news:E3F6A308-2A2E-4F56-84BF-(E-Mail Removed)...
>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 With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      19th May 2009
This site has some info that might help.

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


"Don" <(E-Mail Removed)> wrote in message
news:E3F6A308-2A2E-4F56-84BF-(E-Mail Removed)...
>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 With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      19th May 2009
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 <(E-Mail Removed)>
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I open an Excel Workbook from Outlook macro and activate that workbook? Damil4real Microsoft Excel Discussion 1 25th Jan 2011 04:56 AM
Excel workbook wants to open with Works garwein Microsoft Excel Misc 1 5th Oct 2009 01:35 AM
Creating Workbook in Works w/Windows Vista =?Utf-8?B?RnVsbGVy?= Windows Vista File Management 1 5th Jul 2007 03:01 PM
Macro works in one workbook but not in another sungen99 Microsoft Excel Programming 6 26th Jan 2006 06:25 PM
Runtime error for macro that works in workbook created in =?Utf-8?B?Q3J5c3RhbA==?= Microsoft Excel Misc 1 22nd Jun 2005 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 AM.