Control Objects

Joker4321

Board Regular
Joined
Jan 5, 2007
Messages
60
Hi, I have a table with control check boxes that I copy from one sheet to another when a user needs to insert a new table. The control boxes have code in them that activates a particular textbox when they are clicked and I have made it so only one check box can be selected at a time. Is there a way to transfer the code for the check boxes when I copy and paste them from sheet to sheet? Thanks!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
If you switch to Forms Checkboxes, the assigned code will automatically transfer when copied.
With Controls Checkboxes you will have to build some rather involved code. I wouldn't bother when the Forms Checkboxes already do what you want.
 
Upvote 0
ok...can I have a macro within the forms check box similar to the command checkboxes such as

Private Sub CheckBox1_Click()

End Sub

or do you have to use the assign macro function?

Thanks a bunch John...you've helped a great deal
 
Upvote 0
You are correct.
Just use the Assign Macro option. That macro code will stay with the object when you copy it.
 
Upvote 0
Hey John,

Any ideas on how to copy and paste objects from one sheet to another without activating the sheets?

this is what I have so far

Worksheets("sheet1").Shapes.Range(Array("CheckBox1", "CheckBox2", "TextBox1", "TextBox2" _
)).Select

the above only works when sheet1 is the active sheet.
 
Upvote 0

Forum statistics

Threads
1,218,627
Messages
6,143,586
Members
450,494
Latest member
GolfNut39

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