Hello and welcome back to another class of our course about the complete introduction to this class.
We are still going to talk about Microsoft Excel and VB coding and what I want to practice.
Well, it's pretty simple.
I want to be sure that you guys understand pretty well how the coding part works.
And for this purpose, I just want to do a little bit more practice in this class.
So what we're going to learn is pretty simple.
We're going to use one of our best macros that we have created.
So I modified it a little bit.
So I put it the bold and italic right there.
And basically what I want to do in this class is pretty simple.
It's just creating a multi-step coding mechanism.
So you'll see it's pretty simple and we are going to use strictly the things that we have learned in
the past class.
So once again, it's pretty simple.
All right.
So let's start.
So basically right there, we have our few lines of code.
And if you are able work right now, you should be able to read those few lines of code.
So basically for the range of G five to keep 18.
So from there to there, we want to have all those things in the palace that is calibrate size of 16
and that we don't want to have it both and we don't want to have it.
So basically we can delete those two elements, but we are going to use them since instead of false.
We're going to write down true because I want to change it.
And there we are going to change it as well.
So if we run all this, as you can see, it works pretty fine right now.
Let's say that in the same macro, I want to change a part of this element.
So basically, I want to let's say I want those cells that are right there to be not uncalibrated,
but to be, let's say, in something else or in this case, let's say we want it to be in the area,
for example.
So what exactly will I do?
So it's pretty simple.
So as I said, your macro starts with sub and ends with sub, and this is the part of your code.
So basically this is one action that we want to make.
So each time we make an action, it's described in form.
So basically, this is the first action.
Then the second action will be applied on what exactly?
So it will be applied on the range from each six to G 17.
So this is the first thing that we need to write down.
So we start with writing down this.
So we are this time applying our range to each six.
And we want to have it until G 17.
They do so for the moment, right now, we have our range, so next thing that we want to do is basically
access different library and in this case, modify some other things.
So let's do it.
So right now with.
Basically, the selection got from.
What exactly we want to modify.
So first things first, instead of having calaboose, we want to have I said Ariels.
So this is exactly what we'll do.
So if you guys want to have something else, well, you can write down something else.
So in this case, you want to change your name.
And as I said, the name will be available
then what we can do.
We can also change the size.
We can change and we can make it bold or not bold.
So I'll just copy and paste everything.
It's going to be easier than just writing it down.
So here we have our name here will have our size instead of 16.
Let's say we want to have it at 20 then do we want to use the board?
What do we want to use, bold or not bold?
No.
So where we can delete it, we don't necessarily need it.
And we'll keep the italic part.
Well, basically, we don't want it to be built.
So basically we will add our build because we don't want it to be able to just write down faults.
Why do I do this?
It's pretty simple because if it's true and it's false, what's going to happen?
My well, those cells will not be built, but the rest will be built.
But if I don't write it down.
So basically what's going to happen, it will automatically be the same thing at this one as this one
right there.
And it's going to be considered as true, which is not something that we need.
So I'd say our italic will also be false.
All right.
So what we'll do right now is pretty simple.
We are trying to run our macro and see what it looks like.
Oh, forgot at the end.
So here we go.
So really important each time that you guys write down an action that you want to do.
So it's really important to start with.
You're with in the end with.
So basically, those are all the actions that I want to if you have only one action that you want to
modify.
You can simply write down selections that fund that action or any other thing that you want to do.
So in this case, we are working with the library, but there is a lot of other libraries that we have
to all do right now.
We'll run our macro and see what it looks like.
So this is exactly what we get.
And that right now, as you can see, it's a two step mark.
It's a two step micro that we have just created.
So pretty simple.
As you can see, we, first of all, took this range right there.
We changed the name.
What basically the biggest element right there, basically not the team, but this element right there.
We changed it, then we changed the size.
Then after that, the farm basically doubled and then the italic, another little trick that you guys
can use to remember what's well in your selection, what exactly you want to change.
So it's pretty simple.
So font is right there.
So you can see this is your font.
What we only use font because the only thing that we have learned.
But basically to access a certain library, you need to write down, for example, that font.
In this case, it will be alignment's.
So you can, for example, write down with that with selection, that alignment if you want to modify
the alignment.
But we're not going to do this for the purpose of this class, which is going to stay with what we have
just learned to practice it the max.
All right.
So let's think let's say I want to do I don't know, I want to do another modification.
And in this case, I want to change those elements right there.
So instead of having a size of 20, I want to have a size of twenty five.
And this is exactly what I will do.
So how exactly do we do this?
So let's practice it and see what it looks like.
So first of all, we need to know what is the range.
So the range will be from six until I 17.
So this is exactly what we are going to start with.
So we'll select our range.
So we are going to change it as well, so I six.
Until I was 17, they were all right.
Next thing will be the actions that we wanted.
So what exactly we want to do and those actions.
So pretty simple.
First thing that we want to do, we want to add and underline.
So this is exactly what we will do.
It's pretty simple.
So we are going to write down with, in this case, selection that followed because we are working with
the fund that is right there.
So basically this is the fund and what exactly we want to take from the fund.
So we want to take the we want to change the name.
So let's say in this case, we don't want to change and we want to keep it, Ariel.
So it doesn't really matter.
So next thing, you want to change your size.
Yes.
Want to change the.
So this is exactly what we'll do.
We are going to change the size.
So in this case, we want to have a size of twenty five then what exactly what to do.
The next thing we want to do is pretty simple.
Do we want to keep it bald or we want to.
We don't want it to.
People want it to be the same thing as this one right there.
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
it, if you want to have it bald.
Well, we need to write it down as well.
So in this case, yes, we want to have it, but we'll write down bald and it going to be equal to true.
So we want it to be bold.
And finally, the last thing the we are we going to use the italic, yes or no?
In this case, no.
So let's just write down what we're not going to write it down.
So we want to use we want to use the underlying feature.
So we are going to write down on their line.
In this case, it will be equal to truth.
So right now, we basically have everything we need.
And finally, when we're all done, it's important to close our action with and with.
So this is our third action.
So if we look at what it will look like in inside of our macro, so it looks something like this.
So pretty simple.
So as you can see what happened at first.
So at first that if we look at our micro well, let's bring it bring it back to normal.
In this case, we'll just delete everything that we have.
There we go.
We'll bring it back to 14 and celebrate with everything to.
All right, so what's happening basically inside our micro?
So first step of what exactly happens, it's pretty simple.
The first part of macro will be applied to all those elements.
So basically, this would be the first part.
What's going to happen in the first part is that all our elements will be in Chalaby, will be written
in color and also a size 16.
Then we are going to apply a double feature and the italic feature.
So basically, this is the first step.
As you can see, it starts there and finishes there.
Then the second step of our application is pretty simple.
This time the step will only be applied from age six to 17.
So basically it's starting, in my opinion, right there from age six to 17.
So it will be applied to this part of basically at the top.
So pretty simple.
And what exactly one.
Well, what's happening there?
First of all, all the text will become will go from Kalbarri to Ariel and it will go at a size of 20.
It's not going to be bold anymore and it's not going to be telic anymore.
So basically, this is what exactly happens in this step.
And finally, in the last step, this step is applied to this element right there from ICE six to 17.
So from here to there, first thing the size will become 25.
It's going to be bold.
So basically it's going to be built right there and finally is going to be underlined as well.
So the structure of one line of code is pretty simple.
So basically, first of all, we start with derange to where where exactly we want to apply our code.
Then we are going to make a reference to our library, which in this case, for example, is fun.
And then we are going to like, for example, decide if what the size and what exactly is inside of
the Legos or in this case, in front.
We have decide what the size we have the name we have, what bold italic we have underlying the mistake.
And basically we have all the elements that are right there.
We can even work with that.
Borders or no borders once again with the borders that we can apply.
But it's a little bit more complicated.
So I'm not going to show it right now.
But it's pretty simple and works pretty much not only with fun, but it works with all the other things.
So once again, we are up just to see what it looks like.
So it should look something like this.
And you can see it's well, it's pretty simple to understand when we try to just go in the code step
by step.
And as you can see, it does as well.
Some really simple things right now, because what we have what we are learning is pretty simple.
But once again, it's pretty cool.
And as you can see, all the things that we can do with the things that we have just learned until now.
So it's a first class goes into our next class.