Control statements are generally the most used. Thus control statements are listed in detail and all other statements are listed at the end of this document for referral elsewhere.
If condition Then statements ... If condition Then statements ... End If If condition Then statements ... Else statements ... End If If condition Then statements ... ElseIf condition Then statements ... Else statements ... End If
Select Case expression Case first case statements ... Case other cases ... Case Else statements ... End Select
This loop will execute atleast once.
Do statements ... Until condition
This loop may never execute.
Do Until condition statements ... Loop
This loop will execute atleast once.
Do statements ... While condition
This loop may never execute.
Do While condition statements ... Loop
While statements ... Wend
In the For loop below the step value can be positive or negative. The step value has a default value of 1.
For counter = start value To end value [Step] step value statements ... Exit For statements ... Next