How?
Set the properties you want for the control: right-click the control, and then click Properties on the shortcut menu.
For information about the properties, press F1 in the Properties dialog box to display the Microsoft Visual Basic Help for Microsoft Forms.
Add VB macro code for a control to be used in Excel
Right-click the control, and then click View Code on the shortcut menu.
In the Visual Basic Editor, write your macro code.
For information about writing macro code, see Visual Basic Help.
To quit, click Close and Return to Microsoft Excel on the File menu.
Add a Web script for a control to be used on a Web page
Click the worksheet anywhere within the data that will go on the Web page.
On the Tools menu, point to Macro, and then click Microsoft Script Editor.
In the Script Editor, write your script, using the control ID to handle events for the control.
For information about developing Web scripts, click the option you want on the Help menu in the Script Editor window.
To return to Excel from the Script Editor, click Exit on the File menu.