Merging 2 files with macros

hansbQR

New Member
Joined
Jul 4, 2019
Messages
5
Dear all, I have a problem which I cannot solve (up till now)
I have two files (A and B). Both files have macro's which are activated by clicking knobs in some sheets in file A and file B.

When I merge these two files, I copy all sheets of file A into file B.
Next I import all modules of file A into file B (exporting / importing)

The result is, that the combined file (which was file B), all knobs of former file A still rever to the old file A.
Up till now I repair this problem by re-addressing the macro's of file A to the combination file.

I am looking for a autotated solution to save time and avoid failures (introduced by the hand job).

Is there anybody who can help me out?

Rgds hansbRQ
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi there. You could try putting the relevant macros in individual worksheet code areas of flie A, then when the sheet is copied the macros will go with it and refer to the newly created copy.
 
Upvote 0
Hi there. You could try putting the relevant macros in individual worksheet code areas of flie A, then when the sheet is copied the macros will go with it and refer to the newly created copy.

This is brilliant, many thanks. The most simple solution & it really works fine.
Rgds, hansQR
 
Upvote 0

Forum statistics

Threads
1,224,755
Messages
6,180,776
Members
452,996
Latest member
nelsonsix66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top