vba ternary code example Example: vba ternary Sub condition() temp = 15 msgbox IIf(temp >= 20, "hot", "cold") End Sub