PDA

View Full Version : [SOLVED] Assign Macro to Button on Spreadsheet



sheeeng
06-20-2005, 11:44 PM
Hi all,

I have buttons on spreadsheet. btShow and btExit.

But why one of the buttons show "Assign Macro" when right click it, and another one did not have this "Assign Macro" thing?

sheeeng
06-20-2005, 11:46 PM
Hi all,

I have buttons on spreadsheet. btShow and btExit.

But why one of the buttons show "Assign Macro" when right click it, and another one did not have this "Assign Macro" thing?

This is the other button. Note the right click diference.

Why this is happening?

Brandtrock
06-21-2005, 02:04 AM
Sheeeng,

Excel allows you to add two types of controls, those from the Forms toolbar and those from the Control Toolbox toolbar. The button from the Forms toolbar allows you to Assign a macro. The button from the Control Toolbox toolbar allows you to View Code. Through this option, you can add a macro to the button's Click event (among others).

In general, the Control Toolbox controls (buttons and others) offer wider flexibility.

HTH,

Bob Phillips
06-21-2005, 02:04 AM
You have created two different types of buttons, one from the forms toolbar, one from the control toolbar. The former simply has a macro assigned to it, the latter is event driven.

sheeeng
06-21-2005, 08:26 AM
Thanks. To recap, one from Control Toolbox, another from Forms ToolBar.
Another marked solved.