Excel VBA formulas for Spreadsheet by Sharath Kumar Peechara - HTML preview
Download the book in PDF, ePub, Kindle for a complete version.
Exercise 1: IIF Function
1. Create a UDF (User Defined Function)
To create this Function, execute the following steps
- Open Excel VBA (Altl + F11)
- Insert a New Module
- In the Project Explorer, double click on the Module
- Add the following code line:

This Will Create A new UDF (User Defined Function) with name imedife,we Can use this As we Required. now type in Excel the function = imedife ,the UDF shows in small letter to differentiate itself from Standard Excel Formula
This Code lines will create function imedife ()
In Cell B1 Type
= imedife (A1)

2. Use Excel Formulas (Lookup,Vlookup)
Syntax
IF(logical_test, value_if_true, [value_if_false])
=IF(A1<18,"Minor","Major")
