From the course: Excel for Engineering Professionals

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Conditions: If, Then, and Select Case

Conditions: If, Then, and Select Case - Microsoft Excel Tutorial

From the course: Excel for Engineering Professionals

Conditions: If, Then, and Select Case

- [Instructor] Decisions, decisions. Engineers make decisions all the time. Will this material last long enough for the bridge to hold up? Can I combine these materials without fearing corrosion? In programming VBA, you often need your code to do something different depending on a condition too. I'll show you the two most important decision structures of VBA. The first one is the if then structure. VBA is one of the few programming languages that are relatively easy to read. Some statements actually sound like English. If you look at the if statement it reads if some condition then. So that's literally what's going to happen. If the information between the square brackets is true then the green section is going to be executed. If it's not, then we jump over to the end if statement. So effectively all statements between the first if and the next and if will be executed when some condition is true. So let's have a look at…

Contents