# VBA IFF Function

Home ➜ VBA Functions LIST (Category Wise) ➜ **How to use the VBA IIF Function (Syntax + Example)**

**What is VBA IFF Function**

The VBA IFF function is listed under the logical category of VBA functions. When you use it in a VBA code, **it evaluates the value supplied for a condition** and returns a value is the condition is TRUE else the other value if that condition is FALSE. It’s just like the IF function in the worksheet.

## how to use it

To use VBA's IFF function you need to understand its syntax and arguments:

### Syntax

**IIf(Expression, TruePart, FalsePart)**

### Arguments

**Expression**: The condition which you want to test.**TruePart**: The value to return if "Expression" is TRUE.**FalsePart**: The value to return if "Expression" is FALSE.

It’s better to use VBA IF statement instead of IIF as it makes code hard to read.

About the Author

Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can ﬁnd him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.