Expected 'If'

You created an If...Then...Else block, but did not properly terminate the block. A block If statement must be the first statement on a line, and must end with an End If statement. The following demonstrates the correct structure of a If...Then...Else block.

                      If condition Then
   [statements]
[ElseIf condition-n Then
   [elseifstatements]] . . .
[Else
   [elsestatements]]
End If

To correct this error

  • Check to see if you ended your block If statement with an End statement. If so, change it to an End If statement.

See Also

Reference

If...Then...Else Statement