You are on page 1of 2

Macro(2)

Running a macro using a button.


Always running a macro by going to “Tools menu” is a long process.
Macro can also be executed by creating a button.
Step1. Goto View Menu  Tool bars  Form Controls.
Form Controls tool bar will appear.
Step 2. Click on the “Push button” and drop it in the Sheet1.

Step 3. Now the “Push Button” is in the “Design Mode” means it cannot do its functionality.
Step 4. Right click on the “Push Button”. Click “Control” option. One dialog box appears like below.

Step 5. There are 2 tabs. 1) General 2)


Events.

Step 6. Click on General Tab and give the Label name as “Total Marks”.

Step 7. Now click on the Events Tab. And click on “Mouse Button Pressed” event among all the events present in the

“Properties: Push Button”. The below dialog box appears.


Step 8. Click on “Macro” button.

Step 9. “Macro Selector” dialog box appears. Select the macro you want to assign to the push button. And Click OK.

Step 10. Now the “Push button” is in Design mode on. Click on the icon to off the Design mode

Step 11. Run the macro by clicking on the Push button.

You might also like