1 00:00:00,390 --> 00:00:05,580 Hello, guys, and welcome back to another class, of course, about the complete introduction to VBA 2 00:00:05,580 --> 00:00:07,120 with Microsoft Excel. 3 00:00:07,890 --> 00:00:13,710 So in this class, we are going to talk about basically what we talked about, the macros in the past 4 00:00:13,710 --> 00:00:14,250 few quarters. 5 00:00:14,250 --> 00:00:19,230 And in today's class, we're going to talk about what exactly is behind those macros. 6 00:00:20,220 --> 00:00:23,540 So when we're talking about the macro, what exactly is a macro? 7 00:00:23,550 --> 00:00:29,700 So basically, macro is a set of actions that we have recorded in order to reproduce it and to make 8 00:00:29,700 --> 00:00:31,690 a project a little bit easier. 9 00:00:32,220 --> 00:00:36,990 And basically, it looks pretty simple at first. 10 00:00:37,170 --> 00:00:42,330 But when we go really well, when we try to understand what exactly is inside of a macro, it's a little 11 00:00:42,330 --> 00:00:43,110 bit more complex. 12 00:00:43,110 --> 00:00:48,900 And inside of a macro there is a set of code that is written down to be able to run it. 13 00:00:49,290 --> 00:00:51,600 And it's not always simple. 14 00:00:51,600 --> 00:00:54,570 Sometimes it's really complex to make really simple actions. 15 00:00:55,360 --> 00:00:59,330 And basically all this is programmed in VBA into this class. 16 00:00:59,340 --> 00:01:04,440 We are going to talk about all the interface of the interface that is around all this. 17 00:01:04,440 --> 00:01:07,800 And we're going to take a look at the code, basically what it looks like. 18 00:01:07,980 --> 00:01:11,130 We're going to see where the macros are exactly. 19 00:01:11,130 --> 00:01:16,830 And basically talk about the VBA interface and where you will write down your code. 20 00:01:17,850 --> 00:01:18,570 So pretty simple. 21 00:01:18,570 --> 00:01:21,560 First thing that I suggest you do is simply go into developer stuff. 22 00:01:22,050 --> 00:01:26,470 You can click on it and basically go into visual basics right here. 23 00:01:26,880 --> 00:01:28,520 So it should look something like this. 24 00:01:28,530 --> 00:01:36,780 So normally, if you have nothing right there, this simply means that you have no macros that are safe. 25 00:01:36,990 --> 00:01:38,050 That's the only reason. 26 00:01:38,490 --> 00:01:41,450 So if you have a macro, you should have something right there. 27 00:01:41,580 --> 00:01:46,710 So you would have model one model to model three if you have a lot of well, depending of how much macros 28 00:01:46,710 --> 00:01:47,370 you guys have. 29 00:01:48,210 --> 00:01:50,400 And usually you should have your code right there. 30 00:01:51,210 --> 00:01:53,300 So and then another thing basically. 31 00:01:53,310 --> 00:01:58,590 Well, basically, when you want to add another module or create another macro, how exactly do you 32 00:01:58,590 --> 00:01:58,990 do this? 33 00:01:59,160 --> 00:01:59,850 It's pretty simple. 34 00:01:59,850 --> 00:02:05,190 You just go in the insert right here and you click on Model because you want to create another macro 35 00:02:05,550 --> 00:02:08,460 and then the module will appear in inside of this module. 36 00:02:08,460 --> 00:02:13,010 We can simply write down something so we can write down, I don't know your code. 37 00:02:13,440 --> 00:02:15,600 So here we'll have, for example, code example. 38 00:02:15,780 --> 00:02:18,990 So then I can run it if this code was valid. 39 00:02:19,410 --> 00:02:21,710 But in this case, it's just an example. 40 00:02:21,720 --> 00:02:24,070 So we are not going to try to run it. 41 00:02:25,440 --> 00:02:26,820 So this is for the first part. 42 00:02:26,950 --> 00:02:34,170 Now, basically, you understand that the code is going here and all the modules are basically macros 43 00:02:34,170 --> 00:02:34,880 that you guys have. 44 00:02:34,890 --> 00:02:39,750 So basically all the macros that we have created in the past few classes are simply stored right there 45 00:02:39,750 --> 00:02:42,040 inside of all the modules that we have. 46 00:02:42,060 --> 00:02:44,450 So as you can see, all the macros are right there. 47 00:02:44,850 --> 00:02:49,260 So if you look at the first one, we have Practice Micro, which is one of our macros. 48 00:02:49,260 --> 00:02:50,910 We have practice micro too. 49 00:02:51,330 --> 00:02:53,190 We have final practice. 50 00:02:53,190 --> 00:02:55,680 We have all the macros that basically we have created. 51 00:02:56,010 --> 00:02:58,750 It's possible to run our macros from here. 52 00:02:58,770 --> 00:03:00,180 So basically we run our macro. 53 00:03:00,570 --> 00:03:05,910 As you can see, it's automatically appearing right there, which is which, as you can see here, we 54 00:03:05,910 --> 00:03:07,310 have one of our macros. 55 00:03:07,860 --> 00:03:13,700 And in this case, it's the macro that we have created in, I think, the past few classes. 56 00:03:13,710 --> 00:03:14,970 Well, in the past two classes. 57 00:03:15,960 --> 00:03:19,290 And basically this is the final project that we had. 58 00:03:21,330 --> 00:03:23,550 So basically, this is how you run your macro. 59 00:03:23,570 --> 00:03:24,810 This is how you stuff your Maku. 60 00:03:24,810 --> 00:03:30,360 If you guys have basic knowledge of Python and you worked with by term, normally you should understand 61 00:03:30,360 --> 00:03:30,560 it. 62 00:03:30,570 --> 00:03:32,430 Otherwise, this is how it works. 63 00:03:32,730 --> 00:03:36,660 And don't worry, in the next few classes, we're going to talk a bit more in depth about it. 64 00:03:37,890 --> 00:03:38,300 All right. 65 00:03:38,310 --> 00:03:41,670 So basically, those are the basics of visual basics. 66 00:03:41,670 --> 00:03:46,620 So just understand your code goes here and this is where you will program the macros, your modules 67 00:03:46,620 --> 00:03:50,770 or your macros that we have you have created and all your sheets are stored right there. 68 00:03:51,480 --> 00:03:51,930 All right. 69 00:03:52,380 --> 00:03:57,540 Next thing that is pretty important to understand will be immediate window, which is right here and 70 00:03:57,960 --> 00:03:59,880 in other programming languages. 71 00:03:59,880 --> 00:04:03,000 Usually when you're working with Biram, you have a terminal. 72 00:04:03,000 --> 00:04:07,310 And basically this is pretty much like a terminal, but it's a little bit different. 73 00:04:07,320 --> 00:04:12,560 Basically, what you can do in this immediate window is testing outdraw. 74 00:04:12,810 --> 00:04:18,510 So let's say you have run down a little micro, a little set of code, and it's possible to test it 75 00:04:18,510 --> 00:04:22,590 inside of the immediate window, which is, in my opinion, pretty cool. 76 00:04:22,830 --> 00:04:26,460 So you can test your McCRUDDEN, then integrate it to your code. 77 00:04:27,240 --> 00:04:31,980 Another thing that you can do, we can, for example, ask questions to, I don't know, to excel. 78 00:04:33,510 --> 00:04:38,610 An example of questions that you can ask is, let's say, for example, what is in a certain case, 79 00:04:39,210 --> 00:04:41,760 what is the type of values that is in certain cases? 80 00:04:41,770 --> 00:04:47,550 For example, if it's letters, if it's numbers, if it's safe, there is nothing you can basically 81 00:04:47,760 --> 00:04:54,390 ask except those types of questions, which is once again pretty cool and can be useful in certain situations. 82 00:04:55,500 --> 00:04:57,290 So how exactly do you generate this window? 83 00:04:57,300 --> 00:05:00,570 Because some of you will not have it so pretty simple. 84 00:05:00,570 --> 00:05:06,390 You simply go on view and you click on immediate window and basically automatically appear and you should 85 00:05:06,390 --> 00:05:11,520 have it there right next and last thing that we are going to talk about today. 86 00:05:11,520 --> 00:05:13,290 But it's really, really important. 87 00:05:13,290 --> 00:05:20,160 Of course, it's the object browser, which is the list of all the libraries that we have into VBA. 88 00:05:21,060 --> 00:05:22,970 So what exactly is the library so? 89 00:05:22,990 --> 00:05:27,660 Well, when we're talking about the library, we can, for example, think of the math library inside 90 00:05:27,660 --> 00:05:28,100 of Python. 91 00:05:28,650 --> 00:05:34,020 We're all other or all other libraries that are present in Python. 92 00:05:34,260 --> 00:05:36,220 Basically in Excel, it's pretty much the same thing. 93 00:05:36,240 --> 00:05:42,780 So if you want to do complex applications or complex use of the bee, you need libraries to be able 94 00:05:42,780 --> 00:05:47,470 to have access to certain calculations for certain functions. 95 00:05:47,820 --> 00:05:49,620 Basically, this is exactly what it is. 96 00:05:49,860 --> 00:05:54,240 And as you can see here, you have plenty of different things that you can do. 97 00:05:55,910 --> 00:06:03,380 And it's all useful in that Web programming language, so for now, this those are really the basics 98 00:06:03,380 --> 00:06:10,760 that you guys need to understand for a VRBA Well, before the introduction of the platform where we 99 00:06:10,760 --> 00:06:15,150 are going to write down the code in the next few classes, we are going to write some lines of code. 100 00:06:15,740 --> 00:06:16,400 So pretty simple. 101 00:06:16,400 --> 00:06:18,290 If you want to save your project, that's going to be here. 102 00:06:18,290 --> 00:06:22,720 If you want to come back, it's going to be here where you just click on controls that to run your code, 103 00:06:22,730 --> 00:06:26,210 it's going to be there and well, you can import export your file. 104 00:06:27,050 --> 00:06:29,470 So basically, as I said, those are really the basics. 105 00:06:29,480 --> 00:06:31,370 I don't want to give too much information once again. 106 00:06:32,000 --> 00:06:36,590 But for the moment, this is exactly what you need to start out the programming part. 107 00:06:37,070 --> 00:06:40,490 So that's it for those guys and to open our next class.