Error Messages/40206

Warning message

The expression evaluation is attempting to use the "else" result from an IF-THEN construct
that does not have an ELSE clause.


Consider this definition of a variable

If Population < 100K Then 'Small'

When this is evaluated and there is a municipality with 100K or more people, there is no value provided by the expression, and thus, this warning results. If the warning is ignored, the value will be Null. In a case like this, you should stop the evaluation and add an Else clause, even if you want the result to be Null, e.g.

If Population < 100K Then 'Small' Else Null

The appropriate time to omit the Else clause is when the result value is going to be ignored no matter what. For example,

If Area = 0 Then MsgBox("x = 0 was encountered");

See Also


You are not allowed to post comments.