Decision Making in Excel VBA

In Excel VBA, we can write decision-making codes based on certain conditions. There are two methods to write decision-making code in Excel VBA, using the If…..Then…Else syntax or using the Select Case…End select syntax.

The syntaxes are exactly the same as VB6.  You need to use both the conditional operators and the logical operators together with If…The…Else statements and Select Case statements.

For example

If sale>1000 Then

bonus=50*sale

Else

Bonus=0

End If

For more information, read the articles below:

Excel 2010 VBA Lesson 10: Using If…Then…Else

Excel 2010 VBA Lesson 11: Using Select Case