you just listen. I will be
trying to explain to you how to use if the NL's structure. I hope you will get it
which would go there directly to
And I have already prepared the macro because the's not crows are getting longer and longer and makes no sense typing them. This one is We're rather simple,
so I'm just going to first explain to you.
So this one is called cell Type,
and let me show it to you how it looks.
So it's where a simple one and it's
this this macro is going to determine if the cell a one
the subsequent self type, and then we go directly with it. So if he is
like you remember, if in Excel it is pretty much the same, only that the syntax is different because now it's a command in the programming language and not the function
in the one cell that there could be typed in myself. So you say if and then application worksheet function is text.
This is a function off visual basic for applications that we use an XL.
It basically gives us true. If
they're this value we're referring to is fixed and false. If it's not
so, uh, here we are selecting range a one.
It means it's a sell single cell,
and we ask, Is it true?
If it is, it will execute what is after then
And in this case, we're going to get message books.
This cell contains text.
If it's not true, so it's not text.
It will go to what's after else
and we'll get the message book this cell doesn't contain next, and we'll close it with and if and of course, we close the 17
So let's just close it.
when you go to Mac Rose and when we go to options,
you can see that I have a signed control shift A to this macro.
So just close this and I will press control shift day
and I get the message the cell contains text.
Simple is that if I type
and breast control shift, eh?
I get the message this cell doesn't contain next. So you have seen that
this is a simple, uh, Microsoft Excel Message books
and it's a default one in
this function off visual basic, which is message box. And then this cell doesn't contain text. Now, after this, I could
put some other options
and it can be visual basic motile exclamation
and so on and so on and so on. So they're quite quite an option. It will give us the air because I have West left the comma here so we won't save any changes. It's just for you to see how it's functioning. So this is how the if function works.
next example, we're going to go to the most more complex if structure,
but so far, this is it.