[Not tested] Works the same as it's VB IIF equivalent. IIf will coerce an expression into Boolean and return values based on that expression.
All three arguments are passed by value and not by reference. You cannot pass object references by value. Returns variant.

Public Function IIf(ByVal expression, ByVal Value_if_true, ByVal Value_if_false)
 if cbool(expression) then IIf = Value_if_true else IIf = Value_if_false
End Function


ByVal expression, ByVal Value_if_true, ByVal Value_if_false

Views 129 Downloads 54

Perm link