One of the most basic things that you can do in VBA is record a macro. It can be really helpful, even if you're really good at VBA. Sometimes you forget how to do something, or maybe there's something that you do do often and you can just record a macro to sort of understand the code, the VBA code for doing different procedures in VBA. So I've got a bunch of data here. I'm going to just click in just a random cell here and I'm going to go into the Developer tab. Now if you don't have the Developer tab, you can go to file> options and here in the customize ribbon you can just make sure that the Developer tab here is selected and that'll make it so that the recorder is available plus the other tools in VBA. So what I'm going to do, I've got my cell clicked here, I'm going to go to Record Macro. So I'm going to just, you can name this if you want, you can add a shortcut key, so I'm going to do Ctrl+Shift+G. So Crtl+Shift+G, is going to run this macro, now it's recording everything that I'm doing. So I can go in here to the Home tab. I'm going to maybe format this, just highlight it yellow, maybe make it bold, let's center a line. So I'm going to center a line and maybe make it really big, like 16, all right? And then I'm going to go to the Developer tab and I'm going to stop recording. So it's recorded a macro, be sure to stop recording. A lot of times, especially when I was new to VBA, I would record a macro and then I'd forget to stop it and I do a bunch more moves and it would just record everything that I was doing. So let's go click on Macros over here, sorry click on Visual Basic. So that brings up this Visual Basic editor. Now it has already placed, if you expand the Modules folder, it's already placed that Macro1, the code, in this subroutine, in this module here. So this is the code for everything that I just did and you can notice some things about this. For example, the color, so the 65535 corresponds to yellow, you have a bold here, so this is how you can make font bold. We have a horizontal alignment which is center. Some of this other stuff you can just neglect, we weren't making any changes, never the less that reports it. Then I increase the selection size to 12 then to 14 then to 16. So now, it's not that important that you know all of this stuff and sometimes l'll just copy and paste in, even if I don't know exactly what all the code is. So let's go back to Excel [COUGH] and I'm going to click my active sum from active cell in a different cell. Now there's a couple ways to run a macro, you can always just go up here to the macros, you can click there and we can run. So look what happens when I run this, it does the exact same formatting, exactly what I did using that macro, the macro1. Let me click on another cell here, another way to bring up the macros is to do Alt+F8. So that brings up the macro names and we can do the same thing, we can run that. And finally, let's go back to Visual Basic and I can always have my cursor in here and I can, let's make sure that we've selected something else. Let's select this negative 10 down here, ALT F11 to get back to the editor and I'm just going to press F5 or you can just run it here with this RUN button here. So, I'm just going to do F5. You have to make sure your cursor is somewhere within that procedure to run it. So F5, ALT+F11 to get back and you notice that we formatted that cell. It's really useful, especially when you're working with arrays and just huge spreadsheets of data. A lot of times I use, I select a block of cells or I select the column, just automatically. So let's just say the data always starts in cell A1. Let me move this up here. Then what you can do is, you can always start in cell A1 and you'll learn about that in subsequent screen cast. But then if I do Ctrl+Shift+Down, I select all of the rows in that contiguous block of cells, in that contiguous column. And that's used a lot, I use Ctrl+Shift+Down a lot or Ctrl+Shift+Right Arrow. If you have just one single cell in a contiguous array, a block of cells like this, you can always do Ctrl+Shift+* or I guess that would be Ctrl+Shift+8 or Ctrl*. So that automatically selects a block of cells. So let's record two macros, because I like to use those, I use Ctrl+Shift+down and Ctrl+Shift+8 a lot. So let's go ahead and record a macro. This is just called macro2 and I'm going to start in cell A1. And then I'm going to do Ctrl+Shift+down and that selects the entire column. Let me stop recording and let's put the cell in B4. I'm going to record another macro, macro3 and I am going to do Ctrl+Shift+8 and that selects the entire block and then we stop recording. So let's go back to Visual Basic and check out what it did. One thing I don't know if you quite caught it, I definitely caught it and I didn't mean to do it. I didn't start with range A1 selected before I ran the macro. So this actually recorded this is how to select range A1. Which if I want this macro to work on any block of cells so one cell and then Ctrl+Shift+Down, you can't have this, otherwise, it will select A1. So let's just put a apostrophe in front of that, and this is Macro2. So let's just go ahead and run Macro2 real quick where I'll have my cursor in C1. So let's do Alt+F8, and I'm going to run Macro2 and that selects the block of cells. So Macro3 was Selecting the CurrentRegion, so if you have just one cell in a block of cells, you do Ctrl+Shift+8, or Ctrl+8, then that selects the entire block. So let's make sure that's working. I put my active cell D7 and we're going to go Alt+F8 to bring up the macros. Then I'm going to run Macro3. And that selects an entire block of cells. And that'll also work on, if we had another block of cells over here, obviously, because it works on any block of cells. So let's click the macros here, Macro3 and run that and it selects that block of cells. So that's basic macro recording, even people who are really good at programming in VBA, they still record macros periodically to put little snippets of code into their bigger pieces of code. All right, hope you enjoyed this screen cast and thank you for watching.