Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
When you use Excel a lot, especially if you're using it for the same tasks over and over again, you'll find that you're executing the same procedures repetitively. Well you might say to yourself, gee, there had got to be a faster and easier way. I keep doing the same thing over and over again. Well you don't have to do it because macros can do the repetitive work for you. Well let's talk about what a macro is. Macros are basically little bits of instruction code that run inside Excel. Now macros can be very simple or they can turn Excel into software development and there is even alone industry of people writing macros for Excel.
Well, how do you create a macro? There are two basic ways. One way is that you can record your mouse clicks and keystrokes, kind of like recording a TV program and then playing it back. The other way is that you can write the program in a language called Visual Basic for Applications or VBA for short. It's a language that Microsoft developed to be used inside of Microsoft Office. So let's talk about the advantages of creating macros by recording your clicks and keystrokes. First is you don't have to know anything about programming and the other is that you already know Excel, so leverage that and let Excel record your knowledge for you.
But there are disadvantages of only recording your clicks and keystrokes. One is that if you don't know Visual Basic you can't modify the macro once you've created it. If you want to modify it, you have to record it over. A macro that you record can't make any decisions. It can't say this number is high or this number is low or whether if the user name is Joe then execute a certain procedure. It really doesn't have any intelligence. Also if you make any mistakes when you're recording the macro, even if you correct them Excel is still going to record those mistakes and the corrections because Excel can't read your mind. It's only recording what you are typing and what you're clicking.
So there are definite advantages to writing macros in Visual Basic. One is that you can modify the macros as much as you like or as much as you understand the VBA. The macros can make decisions for you. So a macro can say well if this number is greater than 1500 then display this message. There are some tasks that you can execute only by writing the VBA and once you know how to use VBA in Excel you know most of what you need to use VBA in Word or PowerPoint or Access or other Microsoft programs.
Perhaps there are down sides to writing VBA code. The first of course is that you have to learn the VBA language and I will be straight with you. It's a bit of a learning curve. Second is that after you write the code you have to test it and you have to debug it, especially if you're going to give your macros to other people to use. Finally, there are some tasks that are very simple and it could actually take longer to program them than to record your clicks and keystrokes and even the best programmers will record clicks and keystrokes as part of their development.
So now that we have an idea of what macros are all about let's go and create some and modify them.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98060 Viewers
80 Video lessons · 141298 Viewers
59 Video lessons · 59661 Viewers
52 Video lessons · 72898 Viewers
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.