I'm wanting to simplify the creaion of a "lookup" by creating a UDF to do a VLOOKUP.
The only thing the user needs to supply is teh Lookup Value. Everything else is "hard coded".
Also, Range Names are assigned to the Table Array area and also a cell that is located in teh Col_index_num column.
Here's the code, but is doesn't work -- it returns a #VALUE error.
Help on what's needed to make this work is appreciated.
The only thing the user needs to supply is teh Lookup Value. Everything else is "hard coded".
Also, Range Names are assigned to the Table Array area and also a cell that is located in teh Col_index_num column.
Here's the code, but is doesn't work -- it returns a #VALUE error.
Code:
Function Page_Commission_Rate(Lookup_Value)
'Worksheet Names are used to assign values to two variables that follow
vTable_Array_Name = ['] & ThisWorkbook.Name & ['!] & "Table_Array"
vCol_Index_CellName = ['] & ThisWorkbook.Name & ['!] & "Lookup_Commission"
vCol_Index_Num = Range(vCol_Index_CellName).Column
Page_Commission_Rate = WorksheetFunction.VLookup(Lookup_Value, _
vTable_Array_Name, _
vCol_Index_Num, False)
End Function
Help on what's needed to make this work is appreciated.