If Function
Syntax
If(condexpr, TruePart, FalsePart)-or-If(TruePart, FalsePart)
Group
Description
Return the value of the parameter indicated by condexpr. Only one of the TruePart and FalsePart is evaluated.
Remarks
The two parameter version
If(TruePart, FalsePart)
is the same as
If(TruePart IsNot Nothing, TruePart, FalsePart)
Parameters
Parameters | Description |
---|---|
condexpr | If this value is True then return TruePart. Otherwise, return FalsePart. |
TruePart | Return this value if condexpr is True. |
FalsePart | Return this value if condexpr is False. |
Example
Sub Main Debug.Print If(1 > 0,"True","False") '"True" End Sub
See also