Excel VBA formulas for Spreadsheet by Sharath Kumar Peechara - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Exercise 11 : Create simplified Vlookup version

 

1. Create a UDF Vlkup( User Defined Function)

To create this Function, execute the following steps

  1. Open Excel VBA (Altl + F11)
  2. Insert a New Module
  3. In the Project Explorer, double click on the Module
  4. Add the following code line:

img21.png

Define Name With Below Range score :A2:C8

img22.jpg

Syntax

VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])

=VLOOKUP(8,score,3,FALSE)