IIf Function
Syntax
IIf(condexpr, TruePart, FalsePart)
Group
Description
Returns the value of the parameter indicated by condexpr. Both TruePart and FalsePart are evaluated.
Parameters
| Parameters | Description |
|---|---|
| condexpr | If this value is True, return TruePart. Otherwise, return FalsePart. |
| TruePart | Returns this value if condexpr is True. |
| FalsePart | Returns this value if condexpr is False. |
Example
Sub Main Debug.Print IIf(1 > 0,"True","False") '"True" End Sub
See also