1 00:00:00,600 --> 00:00:08,610 Hello and welcome back to another class of our course about the complete introduction to this class. 2 00:00:08,670 --> 00:00:16,820 We are still going to talk about Microsoft Excel and VB coding and what I want to practice. 3 00:00:16,830 --> 00:00:18,210 Well, it's pretty simple. 4 00:00:19,110 --> 00:00:24,600 I want to be sure that you guys understand pretty well how the coding part works. 5 00:00:25,020 --> 00:00:29,420 And for this purpose, I just want to do a little bit more practice in this class. 6 00:00:29,700 --> 00:00:32,120 So what we're going to learn is pretty simple. 7 00:00:32,850 --> 00:00:36,810 We're going to use one of our best macros that we have created. 8 00:00:36,810 --> 00:00:38,070 So I modified it a little bit. 9 00:00:38,520 --> 00:00:41,340 So I put it the bold and italic right there. 10 00:00:41,670 --> 00:00:46,140 And basically what I want to do in this class is pretty simple. 11 00:00:46,140 --> 00:00:50,940 It's just creating a multi-step coding mechanism. 12 00:00:51,420 --> 00:00:56,160 So you'll see it's pretty simple and we are going to use strictly the things that we have learned in 13 00:00:56,250 --> 00:00:57,230 the past class. 14 00:00:58,500 --> 00:01:00,460 So once again, it's pretty simple. 15 00:01:00,900 --> 00:01:01,280 All right. 16 00:01:01,290 --> 00:01:02,310 So let's start. 17 00:01:02,760 --> 00:01:06,720 So basically right there, we have our few lines of code. 18 00:01:06,720 --> 00:01:11,120 And if you are able work right now, you should be able to read those few lines of code. 19 00:01:11,130 --> 00:01:14,100 So basically for the range of G five to keep 18. 20 00:01:14,730 --> 00:01:25,710 So from there to there, we want to have all those things in the palace that is calibrate size of 16 21 00:01:26,190 --> 00:01:29,460 and that we don't want to have it both and we don't want to have it. 22 00:01:29,850 --> 00:01:35,600 So basically we can delete those two elements, but we are going to use them since instead of false. 23 00:01:35,700 --> 00:01:38,610 We're going to write down true because I want to change it. 24 00:01:39,690 --> 00:01:42,270 And there we are going to change it as well. 25 00:01:43,080 --> 00:01:49,400 So if we run all this, as you can see, it works pretty fine right now. 26 00:01:49,410 --> 00:01:55,960 Let's say that in the same macro, I want to change a part of this element. 27 00:01:55,980 --> 00:02:04,200 So basically, I want to let's say I want those cells that are right there to be not uncalibrated, 28 00:02:04,500 --> 00:02:09,630 but to be, let's say, in something else or in this case, let's say we want it to be in the area, 29 00:02:09,630 --> 00:02:10,270 for example. 30 00:02:10,680 --> 00:02:12,400 So what exactly will I do? 31 00:02:12,780 --> 00:02:13,750 So it's pretty simple. 32 00:02:14,070 --> 00:02:19,910 So as I said, your macro starts with sub and ends with sub, and this is the part of your code. 33 00:02:19,920 --> 00:02:22,270 So basically this is one action that we want to make. 34 00:02:22,770 --> 00:02:25,980 So each time we make an action, it's described in form. 35 00:02:26,310 --> 00:02:27,770 So basically, this is the first action. 36 00:02:28,110 --> 00:02:31,890 Then the second action will be applied on what exactly? 37 00:02:31,920 --> 00:02:37,150 So it will be applied on the range from each six to G 17. 38 00:02:37,470 --> 00:02:40,190 So this is the first thing that we need to write down. 39 00:02:40,200 --> 00:02:42,270 So we start with writing down this. 40 00:02:43,350 --> 00:02:46,770 So we are this time applying our range to each six. 41 00:02:49,040 --> 00:02:52,730 And we want to have it until G 17. 42 00:02:54,570 --> 00:03:01,080 They do so for the moment, right now, we have our range, so next thing that we want to do is basically 43 00:03:01,110 --> 00:03:06,410 access different library and in this case, modify some other things. 44 00:03:06,930 --> 00:03:07,920 So let's do it. 45 00:03:08,340 --> 00:03:10,140 So right now with. 46 00:03:14,400 --> 00:03:19,290 Basically, the selection got from. 47 00:03:20,790 --> 00:03:22,880 What exactly we want to modify. 48 00:03:23,310 --> 00:03:29,400 So first things first, instead of having calaboose, we want to have I said Ariels. 49 00:03:29,400 --> 00:03:30,670 So this is exactly what we'll do. 50 00:03:30,990 --> 00:03:34,440 So if you guys want to have something else, well, you can write down something else. 51 00:03:35,430 --> 00:03:36,950 So in this case, you want to change your name. 52 00:03:37,290 --> 00:03:39,580 And as I said, the name will be available 53 00:03:43,110 --> 00:03:44,080 then what we can do. 54 00:03:44,100 --> 00:03:46,020 We can also change the size. 55 00:03:46,020 --> 00:03:48,690 We can change and we can make it bold or not bold. 56 00:03:48,960 --> 00:03:50,990 So I'll just copy and paste everything. 57 00:03:51,000 --> 00:03:53,340 It's going to be easier than just writing it down. 58 00:03:53,880 --> 00:03:57,450 So here we have our name here will have our size instead of 16. 59 00:03:57,480 --> 00:04:02,700 Let's say we want to have it at 20 then do we want to use the board? 60 00:04:02,850 --> 00:04:05,240 What do we want to use, bold or not bold? 61 00:04:05,520 --> 00:04:05,990 No. 62 00:04:06,030 --> 00:04:09,360 So where we can delete it, we don't necessarily need it. 63 00:04:09,870 --> 00:04:11,770 And we'll keep the italic part. 64 00:04:11,790 --> 00:04:13,250 Well, basically, we don't want it to be built. 65 00:04:13,260 --> 00:04:19,770 So basically we will add our build because we don't want it to be able to just write down faults. 66 00:04:20,520 --> 00:04:21,270 Why do I do this? 67 00:04:21,270 --> 00:04:25,490 It's pretty simple because if it's true and it's false, what's going to happen? 68 00:04:26,250 --> 00:04:29,780 My well, those cells will not be built, but the rest will be built. 69 00:04:29,790 --> 00:04:31,330 But if I don't write it down. 70 00:04:32,070 --> 00:04:36,360 So basically what's going to happen, it will automatically be the same thing at this one as this one 71 00:04:36,360 --> 00:04:36,810 right there. 72 00:04:36,810 --> 00:04:40,800 And it's going to be considered as true, which is not something that we need. 73 00:04:41,850 --> 00:04:44,080 So I'd say our italic will also be false. 74 00:04:44,760 --> 00:04:45,190 All right. 75 00:04:45,210 --> 00:04:47,100 So what we'll do right now is pretty simple. 76 00:04:47,100 --> 00:04:49,620 We are trying to run our macro and see what it looks like. 77 00:04:52,640 --> 00:04:55,020 Oh, forgot at the end. 78 00:04:56,360 --> 00:04:57,110 So here we go. 79 00:04:58,040 --> 00:05:02,980 So really important each time that you guys write down an action that you want to do. 80 00:05:04,580 --> 00:05:06,620 So it's really important to start with. 81 00:05:06,620 --> 00:05:08,450 You're with in the end with. 82 00:05:08,600 --> 00:05:12,500 So basically, those are all the actions that I want to if you have only one action that you want to 83 00:05:12,500 --> 00:05:12,800 modify. 84 00:05:12,820 --> 00:05:18,050 You can simply write down selections that fund that action or any other thing that you want to do. 85 00:05:18,080 --> 00:05:22,700 So in this case, we are working with the library, but there is a lot of other libraries that we have 86 00:05:23,210 --> 00:05:24,080 to all do right now. 87 00:05:24,080 --> 00:05:25,890 We'll run our macro and see what it looks like. 88 00:05:26,240 --> 00:05:28,640 So this is exactly what we get. 89 00:05:28,940 --> 00:05:31,790 And that right now, as you can see, it's a two step mark. 90 00:05:32,300 --> 00:05:35,550 It's a two step micro that we have just created. 91 00:05:36,650 --> 00:05:37,610 So pretty simple. 92 00:05:38,450 --> 00:05:42,620 As you can see, we, first of all, took this range right there. 93 00:05:43,190 --> 00:05:45,360 We changed the name. 94 00:05:45,360 --> 00:05:51,150 What basically the biggest element right there, basically not the team, but this element right there. 95 00:05:51,170 --> 00:05:55,200 We changed it, then we changed the size. 96 00:05:55,640 --> 00:06:03,830 Then after that, the farm basically doubled and then the italic, another little trick that you guys 97 00:06:03,830 --> 00:06:08,880 can use to remember what's well in your selection, what exactly you want to change. 98 00:06:09,560 --> 00:06:10,370 So it's pretty simple. 99 00:06:10,370 --> 00:06:12,320 So font is right there. 100 00:06:12,320 --> 00:06:14,030 So you can see this is your font. 101 00:06:15,620 --> 00:06:18,460 What we only use font because the only thing that we have learned. 102 00:06:18,830 --> 00:06:22,790 But basically to access a certain library, you need to write down, for example, that font. 103 00:06:23,720 --> 00:06:25,230 In this case, it will be alignment's. 104 00:06:25,230 --> 00:06:29,540 So you can, for example, write down with that with selection, that alignment if you want to modify 105 00:06:29,540 --> 00:06:30,170 the alignment. 106 00:06:30,170 --> 00:06:34,460 But we're not going to do this for the purpose of this class, which is going to stay with what we have 107 00:06:34,460 --> 00:06:36,390 just learned to practice it the max. 108 00:06:36,900 --> 00:06:37,270 All right. 109 00:06:37,280 --> 00:06:42,320 So let's think let's say I want to do I don't know, I want to do another modification. 110 00:06:42,560 --> 00:06:46,340 And in this case, I want to change those elements right there. 111 00:06:47,130 --> 00:06:53,240 So instead of having a size of 20, I want to have a size of twenty five. 112 00:06:53,250 --> 00:06:54,560 And this is exactly what I will do. 113 00:06:55,910 --> 00:06:57,350 So how exactly do we do this? 114 00:06:58,160 --> 00:07:00,740 So let's practice it and see what it looks like. 115 00:07:00,770 --> 00:07:03,560 So first of all, we need to know what is the range. 116 00:07:03,890 --> 00:07:08,640 So the range will be from six until I 17. 117 00:07:08,810 --> 00:07:11,500 So this is exactly what we are going to start with. 118 00:07:12,050 --> 00:07:14,270 So we'll select our range. 119 00:07:18,040 --> 00:07:22,570 So we are going to change it as well, so I six. 120 00:07:24,670 --> 00:07:31,390 Until I was 17, they were all right. 121 00:07:31,510 --> 00:07:33,640 Next thing will be the actions that we wanted. 122 00:07:34,030 --> 00:07:36,340 So what exactly we want to do and those actions. 123 00:07:36,340 --> 00:07:37,090 So pretty simple. 124 00:07:37,090 --> 00:07:40,870 First thing that we want to do, we want to add and underline. 125 00:07:40,870 --> 00:07:42,110 So this is exactly what we will do. 126 00:07:42,130 --> 00:07:42,900 It's pretty simple. 127 00:07:43,330 --> 00:07:53,020 So we are going to write down with, in this case, selection that followed because we are working with 128 00:07:53,020 --> 00:07:54,560 the fund that is right there. 129 00:07:54,580 --> 00:07:59,230 So basically this is the fund and what exactly we want to take from the fund. 130 00:07:59,240 --> 00:08:01,330 So we want to take the we want to change the name. 131 00:08:01,330 --> 00:08:04,230 So let's say in this case, we don't want to change and we want to keep it, Ariel. 132 00:08:04,240 --> 00:08:05,440 So it doesn't really matter. 133 00:08:06,460 --> 00:08:09,240 So next thing, you want to change your size. 134 00:08:09,250 --> 00:08:09,610 Yes. 135 00:08:09,610 --> 00:08:10,180 Want to change the. 136 00:08:10,420 --> 00:08:11,710 So this is exactly what we'll do. 137 00:08:11,740 --> 00:08:13,620 We are going to change the size. 138 00:08:13,630 --> 00:08:19,250 So in this case, we want to have a size of twenty five then what exactly what to do. 139 00:08:19,870 --> 00:08:21,970 The next thing we want to do is pretty simple. 140 00:08:21,970 --> 00:08:23,950 Do we want to keep it bald or we want to. 141 00:08:23,950 --> 00:08:24,700 We don't want it to. 142 00:08:24,700 --> 00:08:27,730 People want it to be the same thing as this one right there. 143 00:08:28,600 --> 00:08:33,800 So right now it's not bold, but if we want to keep it not bald, we need to write it down if we like 144 00:08:33,810 --> 00:08:35,210 it, if you want to have it bald. 145 00:08:35,470 --> 00:08:37,170 Well, we need to write it down as well. 146 00:08:37,180 --> 00:08:43,960 So in this case, yes, we want to have it, but we'll write down bald and it going to be equal to true. 147 00:08:43,990 --> 00:08:45,270 So we want it to be bold. 148 00:08:47,050 --> 00:08:52,180 And finally, the last thing the we are we going to use the italic, yes or no? 149 00:08:52,180 --> 00:08:53,240 In this case, no. 150 00:08:54,280 --> 00:08:58,680 So let's just write down what we're not going to write it down. 151 00:08:59,110 --> 00:09:02,290 So we want to use we want to use the underlying feature. 152 00:09:02,300 --> 00:09:05,820 So we are going to write down on their line. 153 00:09:06,520 --> 00:09:09,010 In this case, it will be equal to truth. 154 00:09:14,220 --> 00:09:16,060 So right now, we basically have everything we need. 155 00:09:16,320 --> 00:09:22,140 And finally, when we're all done, it's important to close our action with and with. 156 00:09:22,680 --> 00:09:24,660 So this is our third action. 157 00:09:24,960 --> 00:09:32,900 So if we look at what it will look like in inside of our macro, so it looks something like this. 158 00:09:33,360 --> 00:09:34,080 So pretty simple. 159 00:09:34,090 --> 00:09:36,220 So as you can see what happened at first. 160 00:09:36,480 --> 00:09:42,540 So at first that if we look at our micro well, let's bring it bring it back to normal. 161 00:09:44,130 --> 00:09:47,850 In this case, we'll just delete everything that we have. 162 00:09:49,660 --> 00:09:50,480 There we go. 163 00:09:50,500 --> 00:09:55,740 We'll bring it back to 14 and celebrate with everything to. 164 00:09:57,850 --> 00:10:00,820 All right, so what's happening basically inside our micro? 165 00:10:00,850 --> 00:10:03,820 So first step of what exactly happens, it's pretty simple. 166 00:10:04,630 --> 00:10:09,010 The first part of macro will be applied to all those elements. 167 00:10:09,280 --> 00:10:11,350 So basically, this would be the first part. 168 00:10:11,650 --> 00:10:17,260 What's going to happen in the first part is that all our elements will be in Chalaby, will be written 169 00:10:17,260 --> 00:10:20,700 in color and also a size 16. 170 00:10:20,740 --> 00:10:25,630 Then we are going to apply a double feature and the italic feature. 171 00:10:26,170 --> 00:10:28,000 So basically, this is the first step. 172 00:10:28,000 --> 00:10:30,480 As you can see, it starts there and finishes there. 173 00:10:31,090 --> 00:10:34,630 Then the second step of our application is pretty simple. 174 00:10:34,990 --> 00:10:38,930 This time the step will only be applied from age six to 17. 175 00:10:38,950 --> 00:10:44,770 So basically it's starting, in my opinion, right there from age six to 17. 176 00:10:44,800 --> 00:10:49,180 So it will be applied to this part of basically at the top. 177 00:10:49,750 --> 00:10:50,520 So pretty simple. 178 00:10:51,310 --> 00:10:52,410 And what exactly one. 179 00:10:52,600 --> 00:10:53,740 Well, what's happening there? 180 00:10:53,830 --> 00:11:01,010 First of all, all the text will become will go from Kalbarri to Ariel and it will go at a size of 20. 181 00:11:01,150 --> 00:11:03,830 It's not going to be bold anymore and it's not going to be telic anymore. 182 00:11:04,450 --> 00:11:08,350 So basically, this is what exactly happens in this step. 183 00:11:09,040 --> 00:11:15,700 And finally, in the last step, this step is applied to this element right there from ICE six to 17. 184 00:11:15,730 --> 00:11:20,160 So from here to there, first thing the size will become 25. 185 00:11:20,890 --> 00:11:21,960 It's going to be bold. 186 00:11:21,970 --> 00:11:26,570 So basically it's going to be built right there and finally is going to be underlined as well. 187 00:11:27,430 --> 00:11:29,880 So the structure of one line of code is pretty simple. 188 00:11:29,890 --> 00:11:34,890 So basically, first of all, we start with derange to where where exactly we want to apply our code. 189 00:11:35,830 --> 00:11:40,530 Then we are going to make a reference to our library, which in this case, for example, is fun. 190 00:11:41,650 --> 00:11:48,280 And then we are going to like, for example, decide if what the size and what exactly is inside of 191 00:11:48,280 --> 00:11:49,980 the Legos or in this case, in front. 192 00:11:49,990 --> 00:11:59,080 We have decide what the size we have the name we have, what bold italic we have underlying the mistake. 193 00:11:59,080 --> 00:12:01,890 And basically we have all the elements that are right there. 194 00:12:01,900 --> 00:12:03,400 We can even work with that. 195 00:12:04,060 --> 00:12:09,160 Borders or no borders once again with the borders that we can apply. 196 00:12:09,160 --> 00:12:10,680 But it's a little bit more complicated. 197 00:12:10,690 --> 00:12:12,340 So I'm not going to show it right now. 198 00:12:13,300 --> 00:12:18,920 But it's pretty simple and works pretty much not only with fun, but it works with all the other things. 199 00:12:19,540 --> 00:12:22,980 So once again, we are up just to see what it looks like. 200 00:12:23,290 --> 00:12:25,780 So it should look something like this. 201 00:12:25,800 --> 00:12:32,710 And you can see it's well, it's pretty simple to understand when we try to just go in the code step 202 00:12:32,710 --> 00:12:33,240 by step. 203 00:12:33,460 --> 00:12:35,530 And as you can see, it does as well. 204 00:12:35,530 --> 00:12:39,900 Some really simple things right now, because what we have what we are learning is pretty simple. 205 00:12:40,270 --> 00:12:42,510 But once again, it's pretty cool. 206 00:12:42,520 --> 00:12:48,070 And as you can see, all the things that we can do with the things that we have just learned until now. 207 00:12:48,760 --> 00:12:52,150 So it's a first class goes into our next class.