Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kevin
 
Posts: n/a
Default Copy and pasting files with macros

I have written some macros in an excel file and assigned these macros to
custom toolbar buttons. This works great until I copy and paste the file and
open the new copy. The macro link for the buttons points to the original
macro. Is there anyway to set this up so that I don't have to re-assign the
macro every time and look at the open file instead.
  #2   Report Post  
Nick Hodge
 
Posts: n/a
Default

Kevin

Difficult to tell without the code, but if it has an actual reference in the
code to the workbook name, e.g..

Workbooks("OriginalBook")...........

Then you would do better to use something like the ThisWorkbook object.
This always points to the workbook containing the code.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"Kevin" wrote in message
...
I have written some macros in an excel file and assigned these macros to
custom toolbar buttons. This works great until I copy and paste the file
and
open the new copy. The macro link for the buttons points to the original
macro. Is there anyway to set this up so that I don't have to re-assign
the
macro every time and look at the open file instead.



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
pasting into an excel template without losing the formatting chachi Excel Discussion (Misc queries) 2 January 14th 05 05:08 AM
Copy conditional formatting across multiple rows? Gil Excel Discussion (Misc queries) 1 January 11th 05 12:27 PM
Copy and pasting graphs to PowerPoint JZip Excel Discussion (Misc queries) 0 January 6th 05 09:29 PM
Copy and Paste Steve Excel Discussion (Misc queries) 2 December 2nd 04 01:35 AM


All times are GMT +1. The time now is 03:32 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"