Using Vlookup Where Table_array Is A Variable That Corresponds To A Named Range

Sep 28, 2009

I'm trying to write a vlookup where both the lookup value and the table_array are variables. What I'm trying to do is get a set of dependent drop down boxes to serve as the input for vlookup. The first drop down box contains a list of named ranges and the second contains a list of possible search values. If I manually input the name the function works, but if I refer to it with a cell reference or the indirect funtion it fails. For example:

View 2 Replies


ADVERTISEMENT

Dynamic Range For Table_array In A VLOOKUP.

Oct 10, 2005

I'm looking up a value from another workbook. Simple enough in itself, but
heres the thing.

I'd like to write a dynamic vlookup that checks the value of another cell to
find the table array for it to look up from.

Basically I have a table of data, the column headers are dates. I have a
report that is run daily that I need to look up from. Rather than implicitly
referencing each sheet I'd like to tell the vlookup to check the date in the
column header and use that for the sheet. The range inside of the sheets is
always the same.

View 15 Replies View Related

Dynamic Table_array Element In Vlookup

Jun 22, 2007

how to get the table_array element of vlookup to either obtain details from a worksheet cell, or to enclose a variable (specifically part of the filepath) within the table_array formula. I have a template that gets saved and used in various directories, and I want Vlookup to to dynamically lookup information from a specific file that is also contained within the directory, without having to find and replace the directory name in the vlookup formulas.

View 2 Replies View Related

Referencing Cell Based On User Input That Corresponds To VLookup

Jun 26, 2014

So my issue this time is that I have a bunch of columns that correspond to a month. If the user wants to view data from that month column then they have to link to that cell specifically (the worksheet being used is different than the one in which the month columns are)

My goal was to create a single cell in which the user typed in a month abbreviation such as jan, feb, mar.. so on and so forth. From there they correspond to a vlookup table which tells you which month is in what column (because that part never changes) so jan is in column c and feb is in column d... continuing until december is in column n. So the vlookup corresponds to the table and that works fine, type jan into the cell and the vlookup returns c. So i think this will work.

My problem is that in the cell I am typing this in I want it to be a part of a whole cell reference such as c5 or d7 where the 5 or 7 is a constant (I have that part down) however the reference is to another sheet. So in sheet 2 I want to reference sheet 1 i.e.

Formula: [Code].....

<-- is the desired return.

Right now (in sheet 2) I have

Formula: [Select Code] .....

Which returns the desired d5 but as text and not referencing sheet one. I tried

Formula: [Code]....

But this makes the vlookup malfunction (i think it starts looking in sheet 1 for the month cell but it is not and can not be there.

SO how do i force a vlookup to turn into a cell reference, and how do i make that cell reference come from a different worksheet without causing the vlookup to malfunction.

Attached File : examples.xlsx‎

View 2 Replies View Related

Variable Named Range Sort VBA

Oct 8, 2009

In column B, I have a series of named ranges. The named ranges can vary in order. If I wish to reference a range from a named range say Range("I") to the next unkown named range,

View 9 Replies View Related

Named Range Of Variable Size

Aug 23, 2007

I am attempting to create a rather complex macro to format periodic raw data being made available to me; this data centers around a main column. The column of interest in these raw data reports is of variable length; I wish to apply a name to this column in order to make it easier to perform calculations. I know how to write VBA code to select every cell in a column down to the point at which the column becomes empty space, regardless of how much data is in the column, and I wish a include naming of the range in the macro. However, all my resources imply you must give the exact definitions of the range when writing the name application in VBA. Does anyone know if there is a way to include naming of a range in a macro without knowing the range's exact size? Put another way, is there any way to apply a name to an already-selected group of cells without giving the exact dimensions?

View 2 Replies View Related

Assign Named Range To A Vba Range Variable?

Jan 25, 2013

I have a named range, called SubjectNamesPastoral on a worksheet called Worksheets("Group to Teacher")

I can't assign the named range to the rngSubjectFamilyRangeOnSubjectUsedSheet variable in vba.

the first two lines of code work fine, the msgbox shows "E100:E105", happy days!

However when I try to assign the same range to the rngSubjectFamilyRangeOnSubjectUsedSheet variable, the debugger runs past the 'Set' line without error, but throws 'error 91' at the second msgbox.

VB:
thisString = "SubjectNames" & strSubjectFamilyOfGroup

MsgBox Range(thisString).Address

Set rngSubjectFamilyRangeOnSubjectUsedSheet = Worksheets("Group to Teacher").Range(thisString)

View 1 Replies View Related

Set Variable To Named Range Or Single Cell

Nov 30, 2008

The problem exists with the lists I use. I have a "settings" sheet, where users can choose from preset values to run in the program. E.g. "Urgent", "Semi Urgent" and "Non Urgent" (there are a lot more values, but those will do for now." and the idea is to run them 1 at a time.

However, I've now determined that 99% of the time, they're going to be run 1 after another, that is to say run the program once for "Urgent", then again for "Semi Urgent" and then again for "Non Urgent". So I'd like to loop through these. Again, not a problem, you'd think.

So I added a new value to the list; "All" which users can select to invoke a list. Again, not a problem, I already have the list as a named range, "DmgList" and I can cycle through it. I ran the following test code to see if it would work in theory...

View 4 Replies View Related

VLookup Using Named Range

Jan 14, 2014

I am trying to do Vlookups across multiple sheets but cannot make it work. My result is #VALUE!

When I look at the Function Arguments it says the Table Array is Volatile.

My named range "Centers" has 19 tabs listed.

=VLOOKUP(A114,INDIRECT(""&Centers&"!A5:R395"),13,0)

View 14 Replies View Related

Named Range In VBA Vlookup

Oct 31, 2007

Chik wee (as Borat might say),

I'm wondering? is there any way that you can use a named range for the array in a vlookup that is done in VBA?

my named range is "Lists" and here's my

View 10 Replies View Related

VLOOKUP Using Named Range

Jun 26, 2013

I have a vlookup formula that works when looking up one specific value (ie F2 in example below)

=VLOOKUP($F$2,'All active PRs (RP6)'!B2:L2,12,FALSE)

But now, I want to lookup a range of possible text values (say F2 to F8 which would all have different text values). I've created F2 to F8 as a named range called ISS_Services and created a new formula

=VLOOKUP(ISS_Services,'All active PRs (RP6)'!$A2:$L2,5,FALSE)

But it doesn't want to work consistently. Can vlookup work in this scenario?

View 1 Replies View Related

Vlookup On Non Contiguous Named Range

Jan 20, 2010

I'm trying to do a vlookup on a non contiguous named range.

I have a non contiguous named Range called "temp".

View 6 Replies View Related

Vlookup (named Range (Start_Date) On Another Worksheet)

Aug 17, 2009

I have 18 columns in a worksheet. (Let's say AA:RR). I've filled A1:R1 with the following series: WEEK 1,WEEK 2,.....WEEK 18.

I also have a named range (Start_Date) on another worksheet. Column 1 in that named range is WEEK 1, WEEK 2,......WEEK 18. Column 2 contains Start Dates for each week. If I input the following formula into cell A10:

View 2 Replies View Related

Updating Named Range When New Contact Is Added Using R1C1 Format With A Variable

Feb 1, 2010

The code below is for a macro that allows the user to create a list of contacts. The column containing the names of these contacts are then referenced by a userform (code not present) by way of a Named Range. I want to update the named range whenever the user adds another contact so this new contact shows up in the user form.

I am currently referencing the range containing the names using R1C1 style, but I cannot get the variable aspect to work correctly.

View 2 Replies View Related

Excel 2010 :: VLookup With Named Range Not Updating?

Oct 5, 2011

There is a formula

=vlookup(a1,Named_Range,2,false)

if I change a value in the range named "Named_Range" this vlookup does not update.

This formula works but does not allow for any updates. Meaning the vlookup returns the original value even after a cell has been changed. "Named_Range" is on a different sheet but in the same workbook.

Auto calculate is on. I have recalculated the cell manually. I have Office 2010

View 1 Replies View Related

Vlookup Variable Range

Nov 16, 2007

I am trying to do a vlookup that currently looks as follows:

Range("C2").Formula = "=VLOOKUP(A2,SAP!A$2:AA$42,2,FALSE)"
However, the selection of the table_array (SAP!A$2:AA$42) is a set value. Instead I would like to select all the data that is on sheet SAP. The idea is that the data set will not always be A2:AA42, so I need to make this part variable.

Normally I would use

Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
to select the entire data set.

View 9 Replies View Related

How To Setup Variable Range Name In VLOOKUP

Jan 27, 2012

I need to lookup a value in one of 20 lookup tables. Each table has a range name that is stored in a cell. In the formula below, U79 contains the number I want to lookup and cell P79 has the variable range name. Both formulas give me an N/A error. When I enter the actual range name in the formula, it works. how to use a variable range name?

=INDIRECT(VLOOKUP(U79,P79,2,FALSE))

=VLOOKUP(U79,P79,2,FALSE)

View 3 Replies View Related

Vlookup In Macro With Variable Offset Range

Jun 13, 2008

The message shows me "Can not get the vlookup property of worksheetfunction class" and don't know the reason. The 'plancomm' and 'bonus' is the range name in different worksheets of the same workbook as the rngcell.

Case Else:
.Offset(0, 1).Value = WorksheetFunction.VLookup(rngCell.Offset(0, -3), Range("plancomm"), 2, 0)
.Offset(0, 2).Value = WorksheetFunction.VLookup(rngCell.Offset(0, -4) & rngCell.Offset(0, 1), Range("bonus"), 6, 0)

View 3 Replies View Related

Determining If Cell Is Part Of Named Range And What That Named Range Is?

Aug 16, 2014

Let's say you have a named range, Rng1, which consists of cells A1 & A2. In vba how would you report back what, if any, named range the following cells resides:

Code] .....

here are multiple named ranges so using intersect is not feasible. Essentially, through code, I will be given a range and I need to determine if that range if part of a named range.

View 5 Replies View Related

"Dynamic Named Range" In VLOOKUP

Jan 4, 2009

=+IF(G6=0.25, VLOOKUP(F6,Maple,2), IF(G6=0.375,VLOOKUP(F6,Maple,3),"-"))

This function determines where on the "Maple" named range to get the data based on the thickness of the material (.25 or .375 from G6 dropdown). What I'm wondering is if VLOOKUP's 2nd operator (in this case "Maple") can be filled in dynamically based on another drop-down menu. I have 8 different species and I'd like to avoid a lengthy IF/THEN statement. OR, is there a completely different function that I should be looking at here?

View 3 Replies View Related

Named Ranges On Multiple Sheets With The Same Named Range & I Cant Figure Out How To Do This

Jun 2, 2006

I need to create a named range on multiple sheets with the same named range & i cant figure out how to do this. EG :- I want to create a named range called "_SubUnitRows" on sheet1 starting from "A1:A50" & other named range again called "_SubUnitRows" on Sheet2 starting from "A1:A25" ...

View 2 Replies View Related

Making Named Range The Last Active Value Used Within Another Named Range?

Jul 19, 2013

I'm trying to make my named ranges remember the values of the last active cells used within another named range. The purpose of this is to make my charts dynamically change dependant on two criteria selected. My spreadsheet currently updates itself as and when I change the active cell within a single named range, dynamically changing the chart data by using Lookup based on the active cells value. However I want to get away from having several charts showing, I would like to have a single chart which dynamically changes based on a second selection. So the first selection is for a department (Facility) which changes the chart data relevant to that department, the second selection is to dynamically change the chart shown for the pre selected department.

Picture2.jpg

Using the following code when updating just one criteria with several charts

VB:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Application.Intersect(ActiveCell, [MeasureType]) Is Nothing Then
[valMeasurePicked] = ActiveCell.Value [code].....

which works fine but I'm not sure how to add a second selection criteria because my code uses Activecell. I thought that the VBA needed to set the last used value of a range as a variable and therefore allow the second criteria to be selected but am not sure how to put it into practice.

View 2 Replies View Related

HLOOKUP Function Look For A Column Heading In More Than One 'table_array'

Oct 29, 2008

Can a HLOOKUP function look for a column heading in more than one 'table_array'

View 4 Replies View Related

Countif- Use A Named Criteria As Well As A Named Range

Oct 25, 2009

if I can use a named criteria as well as a named range. In essence what I am looking to do is count certain cells that meet the criteria in a certain named named range,

View 9 Replies View Related

Combine Two Named Ranges Into 3rd Named Range

Mar 14, 2013

Merge two columns into one list in excel

I would like to combine List1 and List2 into a 3rd named range called List3. I was wondering if this were possible without using any additional cells/columns (i.e. I don't want to use Column C like in the example shown in the link above).

Here's the formula from the example:

Code:

=IFERROR(INDEX(List1,ROWS(C1:$C$1)),IFERROR(INDEX(List2,ROWS(C1:$C$1)-ROWS(List1)),""))

I've played around with it, but could not come with any that worked.

View 3 Replies View Related

Select Entire Row With A Named Variable

Feb 6, 2007

I have this problem quite often and always have to think of a way around it, however I think there must be a simple method of doing what I want.

If I want to select row three, I would write:

Rows("3:3").Select

However, if I have a variable which holds my row number how do I rewrite the above code? I've tried serveral varations of:

Rows("CurrentRow:CurrentRow").Select

View 9 Replies View Related

Retrieve Password From Named Variable After Closing?

May 14, 2014

I've named the password to my protected workbook using this code:

ActiveWorkbook.Names.Add Name:="password", RefersTo:=pWord1

I then want to be able to close down Excel, switch off the computer, open all back up again and retrieve the password. I've tried the code:

pWord1 = Evaluate(ActiveWorkbook.Names("password").RefersTo)

But I get this:

Run-time error '1004': Application-defined or object-defined error

How to retrieve the password from the named variable after closing?

This is to protect and unprotect the workbook whenever I open and close it to timestamp a spreadsheet in it. I don't want the daily user to be able to see the time stamped spreadsheet and so need to keep it hidden and the spreadsheet protected over the course of many days when I'm not round.

View 2 Replies View Related

Indirect Referral To Variable Size Named Ranges

Feb 13, 2007

I am trying to use a combination of dependent named ranges and variable length ranges, so one can select in eg Col A truck name from a drop down list, and then in Col B, the engine variant only for that make of truck. The indirect(substitute) function works well if I define the dependent range name (the engine variant) using actual cell refs. However if I use the variable length name definition as described in Ozgrid (ie with offset function), I get an error message and the dropdown menu freezes. Is there anyway to overcome this without resorting to VBA?

View 4 Replies View Related

Vlookup With Named Ranges

Jan 14, 2009

I am having problems getting the code below to follow my intentions. I have 2 files. I have a temporary file that holds all the data that I need. I have a destination file that needs to have data copied into it. In the temp file, I have data for several dates and product types. What I intend to do is to do a vlookup in VBA to look for the date and the product type in the temp file and copy the appropriate data to the destination file. I have numerous named ranges both in my temp file and my destination file. For the code below, I wanted to make a loop to find the date in the temp file that is listed in the destination file. Once this is done, I wanted to find the product type in the temp file that is listed in the destination file. If both conditions exist, then copy a certain range from the temp file to the destination file. My intention is evident in the code, but I don’t think that I am putting in the correct “code format”.

View 9 Replies View Related

VLookup, Named Ranges And IF

Feb 19, 2010

=VLOOKUP('ITEM ADD-CHG Form'!Z19,Brand_V,2,FALSE) Another wrench!. If the value in cell Z19 is not found in the named range "Brand_V", the formula returns #N/A. I need to replace #N/A with the verbiage DEF while leaving the other results intact.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved