Solved

Change vlookup-range in function

Posted on 2011-03-25
3
190 Views
Last Modified: 2012-08-14
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
 
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

Open in new window


What is going wrong ?

Thank you very much
0
Comment
Question by:Steven Vermoere
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Expert Comment

by:nutsch
ID: 35217201
use indirect to convert a range string to an actual range

=vlookup(a1,indirect("B1"),2,0)

Thomas
0
 
LVL 39

Accepted Solution

by:
nutsch earned 250 total points
ID: 35217207
not indirect("B1"), indirect(B1), sorry

=vlookup(a1,indirect(B1),2,0)

Thomas
0
 

Author Closing Comment

by:Steven Vermoere
ID: 35230486
Yes, this was it. Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question