Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
549 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Written by Andy Brown
In this tutorial
You can play a macro that you've recorded (and possibly edited) in several ways:
by pressing the relevant short-cut key
by creating a button on your worksheet
by assigning it to a picture or drawing
by adding a button to the Quick Access toolbar
The rest of this tutorial shows how to do each of these things.
Before you run any of your macros it's always a good idea to save them first, just in case your macro inadvertently crashes Excel (it can happen) causing you to lose all of your work.
If you've assigned a short-cut key to your macro, you can press it now. In our case, it was SHIFT + CTRL + R.
If you want to create a button on your worksheet that you can click on to run your macro, first choose to insert a form button:
Choose this option from the Developer tab (if you can't see this tab, here's how to display it).
If you're wondering why we don't recommend adding an ActiveX control, the short answer is that form controls are embedded as part of your worksheet and are easier to work with. The long answer is ... long.
You can now click and drag to form the outline of your button:
Click and drag with the plus symbol to draw your button.
When you release the mouse button, you can choose which macro to assign to your button:
Here I've only got one macro available, which I recorded in the current workbook.
Finally, you can change the text displayed on your button:
Click and drag across the text of the button, and type something else in.
The easiest way to edit a button that you've created (perhaps to change its caption) is to right-click on it first. If you try to left-click to select a button you will run its associated macro instead!
To assign a macro to a picture, first paste in a picture or insert one:
Here we're inserting a picture from our computer.
Having added a picture, you can right-click on it to assign a macro to it:
Choose this option to assign a macro to your button.
You can now click on your picture to run your macro:
The mouse pointer shows that this image is clickable.
This is probalby the best way to run a macro, as the quick access toolbar is always visible.
The quick access toolbar is at the top of your Excel screen.
Start by right-clicking on the quick access toolbar, and choose to customise it:
Choose this option to customise your Quick Access Toolbar.
Now choose to add a link to a macro:
Choose Macros from this drop list.
Either double-click on a macro to transfer it to the list on the right, or click on it and then click on the Add > > button:
You need to copy your macro to the right-hand list.
Now that you've added your macro to the quick access toolbar, you can change the icon attached to it:
With your macro selected, click on the button to modify it shown above.
Choose any of the icons in the list (you can scroll down to see more), then select OK twice.
Here we've gone for a weird red shape.
You now have a new clickable tool in your quick access toolbar!
Provided your macro is in an open workbook you can click on this tool at any time to run it.
Your customised quick access toolbar will remain visible even when the workbook containing your macro is closed down. If you click on the icon in this case, Excel will automatically open the workbook and then run the macro, which is pretty much what you'd want and expect.
Now you know how to record and run macros, the next step, perhaps, is to learn how to write them.
You can learn more about this topic on the following Wise Owl courses:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.