Use an If...Then structure to execute one or more statements conditionally. You can use either a single-line syntax or a multiple-line block syntax:
If condition Then statement
If condition Then
The condition is usually a comparison. If condition is True, VBScript executes all the statements following the Then keyword. You can use either single-line or multiple-line syntax to execute just one statement conditionally (these two examples are equivalent):
If anyDate < Now Then anyDate = Now
If anyDate < Now Then
anyDate = Now
Notice that the single-line form of If...Then does not use an End If statement. If you want to execute more than one line of code when condition is True, you must use the multiple-line block If...Then...End If syntax.
Use an If...Then...Else block to define several blocks of statements, one of which will execute:
If condition1 Then
[ElseIf condition2 Then
VBScript provides the Select Case structure as an alternative to If...Then...Else for selectively executing one block of statements from among multiple blocks of statements. A Select Case statement provides capability similar to the If...Then...Else statement, but it makes code more readable when there are several choices.
Select Case Weekday(now)