1 00:00:00,710 --> 00:00:07,940 The first step to enhancing excel and adding more functionality is to understand Visual Basic Visual 2 00:00:07,940 --> 00:00:10,670 Basic four applications or VBA. 3 00:00:10,760 --> 00:00:15,980 Is the programming language found in Microsoft products that allows you to add more functionality than 4 00:00:15,980 --> 00:00:22,940 the software is inherently capable of VBA is commonly used in programs like Excel and Access that are 5 00:00:22,940 --> 00:00:27,290 data heavy so we can speed up the data entry or data manipulation. 6 00:00:27,290 --> 00:00:29,430 Data analysis processes. 7 00:00:29,600 --> 00:00:34,400 So it's a good tool to have when developing a database file so that you can build features that are 8 00:00:34,400 --> 00:00:40,880 unique to your specific needs and ensure that you have the functionality required to use your file efficiently. 9 00:00:41,990 --> 00:00:47,510 In a previous video we showed how to set up the developer tab to appear in your ribbon. 10 00:00:47,510 --> 00:00:54,020 So we're gonna go ahead and click on that so we can see the VBA developer interface the primary things 11 00:00:54,020 --> 00:01:01,430 we are interested in are the code and control sections of the ribbon the code section has the Visual 12 00:01:01,430 --> 00:01:05,840 Basic button which opens the VBA window for you to write code in. 13 00:01:06,050 --> 00:01:12,860 It also has the macros button which lets you directly run pre written macros and the record macro button 14 00:01:12,860 --> 00:01:18,140 to record your actions as you perform them to turn them into a macro for future use. 15 00:01:19,310 --> 00:01:25,580 The controls section is how you will build the user interface into your Excel file for your users to 16 00:01:25,580 --> 00:01:30,250 interact with the VBA indirectly rather than having to access your code. 17 00:01:30,320 --> 00:01:33,920 And this is discussed in a future video for now. 18 00:01:33,920 --> 00:01:39,890 Go ahead and open up the Visual Basic window by clicking on the Visual Basic button in the code section 19 00:01:40,400 --> 00:01:42,700 and that should look something like this. 20 00:01:43,010 --> 00:01:47,630 You can see over on the left hand side of the screen There's the project Explorer which is this window 21 00:01:47,630 --> 00:01:48,870 here. 22 00:01:48,890 --> 00:01:54,460 This will list all of your user forms and macros that you have in this particular file. 23 00:01:54,500 --> 00:01:57,380 So ours is empty right now because we don't have anything in it. 24 00:01:57,500 --> 00:02:03,650 But this is the window that you'll usually use to navigate your VBA code that lives in your file. 25 00:02:03,710 --> 00:02:09,440 This lower window here is the properties window which will display the properties associated with whatever 26 00:02:09,440 --> 00:02:15,560 you have selected in the product explore the properties window is really useful and excels version of 27 00:02:15,560 --> 00:02:21,470 VBA since it doesn't have an internal properties function for things like user forms but it isn't as 28 00:02:21,470 --> 00:02:23,350 useful in programs like access. 29 00:02:23,450 --> 00:02:30,400 So we'll be using this window a lot in Excel but not necessarily in other Microsoft programs. 30 00:02:30,440 --> 00:02:34,550 Now we can look at the top of the screen here through some of these tools. 31 00:02:34,580 --> 00:02:38,140 Obviously this is the save button which I recommend you use often. 32 00:02:38,360 --> 00:02:43,490 And if we jump over here we have the undo and redo buttons which you can just use the controls each 33 00:02:43,490 --> 00:02:47,120 shortcut like you do in most other Microsoft applications. 34 00:02:47,120 --> 00:02:53,780 These buttons here the play pause and stop buttons are gonna be very useful when we talk about air proofing 35 00:02:53,780 --> 00:02:55,580 in a later video. 36 00:02:55,580 --> 00:03:00,410 These next two buttons just toggle between your project explorer and properties windows. 37 00:03:00,410 --> 00:03:04,670 If you happen to close out of one of these you can always bring it back by clicking on its corresponding 38 00:03:04,670 --> 00:03:05,440 button. 39 00:03:05,540 --> 00:03:10,740 And this third button here is really useful if you get stuck at any point during your code. 40 00:03:10,760 --> 00:03:15,950 This is the object browser which will show you all of the terms and functions you can call from the 41 00:03:15,950 --> 00:03:17,060 VBA. 42 00:03:17,060 --> 00:03:18,370 We'll talk more about this later. 43 00:03:18,380 --> 00:03:25,130 But keep in mind keep it in mind in case you get stuck trying to figure out VBA terminology. 44 00:03:25,130 --> 00:03:28,020 Next let's look at this debug dropdown. 45 00:03:28,380 --> 00:03:34,070 The debug dropdown has a lot of useful tools in it for trying to find the errors in your code and correct 46 00:03:34,070 --> 00:03:37,400 them and will actually cover all of this in a later video. 47 00:03:38,680 --> 00:03:41,180 Next let's look at the insert dropdown. 48 00:03:41,260 --> 00:03:45,790 Here's where we can insert a user form a module or a class module. 49 00:03:45,790 --> 00:03:50,580 These are the items that will how's your code in VBA in your Excel file. 50 00:03:50,590 --> 00:03:57,980 Let's go ahead and insert a user form and a module we can see the user form and the module have both 51 00:03:57,980 --> 00:04:03,590 showed up in our project Explorer window so this will help us track what we've inserted into the file 52 00:04:03,920 --> 00:04:05,210 and toggle between the two. 53 00:04:06,140 --> 00:04:11,480 Generally speaking user forms are what you build for the user to enter data or interact with that data 54 00:04:11,540 --> 00:04:13,010 indirectly. 55 00:04:13,010 --> 00:04:17,550 These forms have code that are tied directly to them and we'll talk more about that later. 56 00:04:17,630 --> 00:04:23,840 Modules are where you put any code that isn't necessarily tied to a form but you still want to use somewhere 57 00:04:23,840 --> 00:04:25,580 in your file. 58 00:04:25,580 --> 00:04:30,590 So in this video we talked about the VBA interface and some of the key buttons and items we will be 59 00:04:30,590 --> 00:04:31,370 using. 60 00:04:31,370 --> 00:04:33,860 So now we are ready to start coding in VBA.