Transfer Macros across Workbook

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
I have a macro which saves a worksheet as a sheet in a new workbook, on a button click.

On that sheet however there are a couple of other buttons which do various other things such as Print the sheet, Copy part of the sheet, which I would like to still work in the newly created workbook.

Is there a way of doing this?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Thanks,

Looks pretty complex, think I might give it a miss seeing as it won't add too much benefit to my project really.

Thanks anyway, when I get a bit more practiced at VBA and need to do something similar I may give it a go.
 
Upvote 0
As it turns out it was a really simple solution to my problem. As the macros I needed to work only referenced things within the sheet that was saved, I just copied the sub procedures from the modules into the worksheet module.

So when the worksheet was copied over to the new workbook, all the procedures were transferred along with it.

It just meant I had to use ActiveX control buttons to call the modules instead of form control buttons
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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