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 8: Condensing HLOOKUP 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:

img15.png

This Code lines will create function hlkup() In Cell C2 Type

= hlkup(product,Range("produ"), 3, 0)

img16.jpg

Syntax

HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

=HLOOKUP(C25,B17:D22,3,FALSE)