VBA: Using the IF Statement

If you have been creating macros or have been thinking it would be great to automate some everyday tasks you do in Excel, Word, PowerPoint, Access or MS Project then you will find one of the most useful things you need to know is the IF statement.

The IF statement allows you to tell your program what to do based on certain conditions. For example, students who get more than 50% for their exam will be assigned a pass and those with less will fail. You can get VBA to do things based on the answer. In effect you are telling whatever program you are using to think for itself. You are giving it the criteria with which to make those decisions but you only have to do it once.

So wherever you can do something that is logical then the IF statement can be used to make those decisions.

Here in this video tutorial you will see how to use it using an example in Excel.

One thought on “VBA: Using the IF Statement”

Comments are closed.

Making Technology Easy to Understand