Copy an ActiveX Control and Its Code to Excel Worksheets
Question details
The user needs to copy an Excel ActiveX control and its event code to other worksheets.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An ActiveX control on one worksheet needs to be reused on other worksheets.
- Observed behavior
- Copying the control alone can leave the new control without its event procedure because the code is stored in the original worksheet's module.
Open the workbook in a desktop version of Excel that supports ActiveX and VBA, and check that the Developer tab is available. ActiveX controls or macros may be blocked by Excel security settings; only enable content from a trusted source.
Copy the Entire Worksheet with Its ActiveX Control and Code
Use this method when you can duplicate the source worksheet rather than add the control to an existing sheet.
Right-click the source worksheet tab and select Move or Copy.
Choose the destination workbook and sheet position, select Create a copy, and click OK. The copied worksheet includes the control and its worksheet-module code.
On the copied sheet, turn off Developer > Design Mode if it is enabled, then click the control. Check that any worksheet references in the code point to the intended sheets.

Copy the Control and Its Event Code Separately
Use this method to add an ActiveX control to an existing worksheet.
Use Forms Controls with a Shared Macro
Use Forms controls when multiple worksheets need to call the same macro without separate ActiveX event procedures.
Edit Excel Workbooks with WPS Spreadsheet
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easy to move everyday workbook editing to WPS. Excel ActiveX controls and VBA macros may not work the same way, so keep Excel for workflows that depend on them.

Frequently Asked Questions
Why doesn't the copied ActiveX button run its code?
The button's event procedure is stored in the source worksheet module, not in the control itself. Copy the worksheet with Move or Copy, or paste the event procedure into the destination worksheet module.
How do I find an ActiveX control's event code?
Select Developer > Design Mode, right-click the control, and choose View Code. Excel opens the corresponding worksheet module in the VBA editor.
Can multiple ActiveX controls use one shared macro?
ActiveX controls use worksheet event procedures rather than assigned macros. Those procedures can call a shared routine in a standard module, or you can use Forms controls and assign them directly to a shared macro.
Why is my ActiveX control still unavailable after copying it?
Check whether Developer > Design Mode is on and review Excel's ActiveX and macro security settings. ActiveX may be disabled by default in some Office versions; enable content only if you trust the workbook.




