Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Macros, like any other workbook element, are always a work in progress, so you shouldn't hesitate to review them, change their names, or get rid of them if they're no longer needed. In this movie, I'll show you how to manage your macros by viewing, renaming, and deleting them. I'm going to work with the Managemacros sample file, so I'll double-click it. Excel displays the dialog box, indicating that the file does contain macros. I want to work with them, so I will click Enable macros. I will switch to the Developer tab of the Ribbon, which contains my Macro tools.
I did that by going to the Excel Preferences dialog box and turning on the tab. Open the Macros dialog. Here I can select the macro that I want to work with. In this case, I will work with the Relative macro. Because I want to view the code rather than running it, I will click the Edit button. I'll expand this window a bit, so that we can see all the code at one time. This is the code that I recorded in the previous movie. You can see that I started in cell A1 and then selected the cell two rows and two columns away from it and change the font size to 18.
When you record a macro that changes some aspects of a font's appearance, it records everything about that font. So the only change I made in this case was changing the size to 18. Then I moved two columns down and two cells to the right again, and I changed, down here, the name of the font to Cambria. So I did that to the second cell. After that, I stopped recording. Now, let's say that I want to change the name of this macro. To do that, I go up here to what's called the macro declaration, or the name of the macro.
It's Sub, which stands for Subroutine, and here is the name of the macro. If I want to rename it, I click outside of the parenthesis and edit the name. So in this case I want it to be RelativeRefs. Now that I've done that, I can save my work. Again, you just press Command+S to save. Then to go back to Excel from within the Visual Basic Editor, you can click the View Microsoft Excel button. When you do, you go back to Excel. Now when I open the Macro dialog box by clicking the Macros button, you'll see that I have Absolute I and also have RelativeRefs.
So I've successfully renamed my macro. If I were to try to rename the macro from within the Macro dialog box, say, for example if I called it RelativeRefs2, if I were to press the Return key or click Create, it would actually create a separate macro, not rename this one. So that's an important 'gotcha' to watch out for. Now let's say that I want to delete a macro. For example, I only want to keep the RelativeRefs macro; I don't want to keep Absolute. To do that, I can click the Absolute macro's name here in the Macro dialog box and then click Delete.
When I do, Excel asks if I'm certain that I want to delete it. I will say yes, and it's gone. Macros don't have to stay the same after you record them. If there is some aspect of them you would like to change, go ahead and do it.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.