Specify whatever condition for condition an specify a whatever statement to be excectued when condition is true
If condition [ Then ]
[ statements ]
[ ElseIf elseifcondition [ Then ]
[ elseifstatements ] ]
[ Else
[ elsestatements ] ]
End If
' Single-line syntax:
If condition Then [ statements ] [ Else [ elsestatements ] ]
condition
Required. Expression. Must evaluate to True or False, or to a data type that is implicitly convertible to Boolean.
If the expression is a Nullable Boolean variable that evaluates to Nothing, the condition is treated as if the expression is not True, and the Else block is executed.
Then
Required in the single-line syntax; optional in the multiple-line syntax.
statements
Optional. One or more statements following If...Then that are executed if condition evaluates to True.
elseifcondition
Required if ElseIf is present. Expression. Must evaluate to True or False, or to a data type that is implicitly convertible to Boolean.
elseifstatements
Optional. One or more statements following ElseIf...Then that are executed if elseifcondition evaluates to True.
elsestatements
Optional. One or more statements that are executed if no previous condition or elseifcondition expression evaluates to True.
End If
Terminates the If...Then...Else block.
Select Case Hour(Now),Case 7 To 18for Day shift,Case Elsefor Night shift.End Select, then change the Subject field within the Case.