Steven Vermoere
asked on
Change vlookup-range in function
Hello,
I want to create a function that looks in a certain range for a certain value
The name of the range is in cell B1, de value that needs to be looked up is ie cell A1. I have several ranges: BE_UP, BE_DOWN, NL_UP, NL_DOWN. They are al defined
In cell A1 I enter the value that I'm looking for
In Cell B1, I enter the value of the range that he needs looking in
first question: is it possible to do this with the norma vlookup-formula
Second question: in the code below, I tried it, but I do not get any value
What is going wrong ?
Thank you very much
I want to create a function that looks in a certain range for a certain value
The name of the range is in cell B1, de value that needs to be looked up is ie cell A1. I have several ranges: BE_UP, BE_DOWN, NL_UP, NL_DOWN. They are al defined
In cell A1 I enter the value that I'm looking for
In Cell B1, I enter the value of the range that he needs looking in
first question: is it possible to do this with the norma vlookup-formula
Second question: in the code below, I tried it, but I do not get any value
Function VLOOKUPGV(oRNGSearch As Range, oRNGLookup As Range, iCol As Integer, bTemp As Boolean)
Dim sRange As String
Dim dtLookup
VLOOKUPGV = Application.WorksheetFunction.VLookup(oRNGSearch.value, Application.Range(oRNGLookup.value), iCol, True)
End Function
What is going wrong ?
Thank you very much
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, this was it. Thanks
=vlookup(a1,indirect("B1")
Thomas