Running Macros - QAT
- 03:27
Understand how to create a Marco shortcut using the QAT
Downloads
No associated resources to download.
Glossary
Quick Access Toolbar VBATranscript
So to assign a macro to the Quick Access Toolbar, which is the little toolbar at the top here, all we need to do is go to the dropdown menu at the top, then we go to more commands, and then from the choose commands from dropdown list here we're gonna go and choose macros. And it'll list out all the available macros that I've currently got access to, including the ones that we recorded earlier. Enter my name and enter my name too here. To add them to the Quick Access Toolbar, all I need to do is select the one I want and then click on add. When you see the macro come across, it will have a default icon, and the name of the button will be the same as the name of your macro. If you want to change that to make it a little bit easier to read, all you need to do is click on the modify button here. We can now change the displayed text that's gonna appear on that button or on the description. I'm just gonna add some spaces into mine. And if you'd like to you can also change the logo, the icon as well. Once you're done, click on okay. And we now have a new action, which of course we can access using the Alt commands. So we can go Alt and 4 would now run my macro. Okay, so if I'm gonna add a macro to the Quick Access Toolbar, then it makes sense that that macro needs to be available all of the time. So what I just did there, we added a macro that I would hope would be in the personal macro workbook and that's because obviously that button is gonna be there all the time. And if this macro was recorded into this workbook, if I had the workbook closed, then that button still appears in Excel. So this is a bit of a downside because obviously we don't want people clicking on that button when I know that there's no access to the macro. So one way to get around this is in fact Quick Access Toolbar allows me to customize buttons onto it only when certain workbooks are open. So this is really useful. So for example, if we wanted to do exactly the same thing, except only have that button available when this workbook was open, then I'm gonna go back to more commands here to customize the item. I'm gonna remove the item from the all documents Quick Access Toolbar, and then I'm gonna go to this dropdown list at the top and say for Excel VBA and macros. So this is the name of my workbook that I've currently got open. Now I can go across and do exactly the same thing as before, I go and choose the macro I want to add, I can go and modify it as we did before. So I can say, enter my name, go and choose the icon that I want to have, click on okay, and okay again, and you'll see the result is the same, but when the workbook is closed, this button now disappears. When I open it again, this button will now reappear and make this available. So the commands are only available when this workbook is open. So that's a useful feature of customizing the Quick Access Toolbar.