?
Solved

Change vlookup-range in function

Posted on 2011-03-25
3
Medium Priority
?
198 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 1000 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

Industry Leaders: 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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

752 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