ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assign Macron to Button (https://www.excelbanter.com/excel-programming/314158-assign-macron-button.html)

MahaRajŪ

Assign Macron to Button
 
Hi I have recorded a macro to Print the "print area" and made a button on a
sheet.

macro is working properly when I run it. How can I assign to the button.
I could not see anywhere where it says "Assign Macro"
Even in Microsoft help it mentioned that Be in a design mode and right click
on the button and select Assign Macro. I tried but no luck :(

any idea please.

winxp SP2/Office 2003

Thanks



Ron de Bruin

Assign Macron to Button
 
Hi MahaRaj

You are using a button from the Control Toolbox, this button have a click event.
On a button from the Forms Toolbar you can right click and assign a macro

Press the first button on the control toolbox to go into the design mode
Double click on the button you placed on your worksheet.
The VBA editor will open with this

Private Sub CommandButton1_Click()

End Sub

You can place the code in the event or place the macroname in the event.

Press Alt-q to go back to Excel and press the first button on the control toolbox again to exit the design mode

--
Regards Ron de Bruin
http://www.rondebruin.nl


"MahaRajŪ" wrote in message ...
Hi I have recorded a macro to Print the "print area" and made a button on a sheet.

macro is working properly when I run it. How can I assign to the button.
I could not see anywhere where it says "Assign Macro"
Even in Microsoft help it mentioned that Be in a design mode and right click on the button and select Assign Macro. I tried but no
luck :(

any idea please.

winxp SP2/Office 2003

Thanks




MahaRajŪ

Assign Macron to Button
 
Thanks RON
you were right I made button from Toolbox. But I did not know about FORM.

Thanks. it sorted now. I am gonna play with it now.

Maha


"Ron de Bruin" wrote in message
...
Hi MahaRaj

You are using a button from the Control Toolbox, this button have a click
event.
On a button from the Forms Toolbar you can right click and assign a macro

Press the first button on the control toolbox to go into the design mode
Double click on the button you placed on your worksheet.
The VBA editor will open with this

Private Sub CommandButton1_Click()

End Sub

You can place the code in the event or place the macroname in the event.

Press Alt-q to go back to Excel and press the first button on the control
toolbox again to exit the design mode

--
Regards Ron de Bruin
http://www.rondebruin.nl


"MahaRajŪ" wrote in message
...
Hi I have recorded a macro to Print the "print area" and made a button on
a sheet.

macro is working properly when I run it. How can I assign to the button.
I could not see anywhere where it says "Assign Macro"
Even in Microsoft help it mentioned that Be in a design mode and right
click on the button and select Assign Macro. I tried but no luck :(

any idea please.

winxp SP2/Office 2003

Thanks







All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com