MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 3rd, 2002, 08:59 AM   #1
tryingexcel
New Member
 
Join Date: Apr 2002
Posts: 2
Default

I am trying to create a dynamic range that
will change each time my project list changes.

I have seen some code that allowed me to capture the range as the following:
=OFFSET($A$1,0,0,COUNTA($A:$A),4)

(In the Define Name box I called it myRange)

What I need to do is: have another workbook
(when it is called from the first workbook) use the VLOOKUP table to be able to use myRange to find the value I want. I keep
getting errors. Any suggestions, I am kind of new at this. Thanks

Below is a sample of the first Workbook

FY 2001 MY Project List
PROJ NBR PROJ NAME BR NBR BR CHIEF
0176 Demographic LAN Support 18 Lau
0902 Division InterProject 02 Kreilick
0906 CPS 44 Tucker
0937 LEHD 04 Prevost


[ This Message was edited by: tryingexcel on 2002-04-03 08:00 ]

[ This Message was edited by: tryingexcel on 2002-04-03 08:20 ]
tryingexcel is offline   Reply With Quote
Old Apr 3rd, 2002, 09:07 AM   #2
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-03 07:59, tryingexcel wrote:
I am trying to create a dynamic range that
will change each time my project list changes.

I have seen some code that allowed me to capture the range as the following:
=OFFSET($A$1,0,0,COUNTA($A:$A),1)

(except I changed the column from 1 to 4)
In the Define Name box I called it myRange

What I need to do is: have another workbook
(when it is called from the first workbook)use the VLOOKUP table to be able to use myRange to find the value I want. I keep
getting errors. Any suggestions, I am kind of new at this. Thanks



[ This Message was edited by: tryingexcel on 2002-04-03 08:00 ]
The formula you posted does not refer to a sheet in which your 4-column table should be. Be aware of the fact if column A has any blanks interspersed with data, you'll end up with "myRange" which is not computed correctly.

You could post 5 rows (including the column headings/labels) of the range to which "myRange" refers for further help.
Aladin Akyurek is offline   Reply With Quote
Old Apr 3rd, 2002, 09:17 AM   #3
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default

Mr. tryingExcel

try using Insert name define

type in a name say rLookup

=OFFSET('8'!$A$1,0,0,COUNTA('8'!$A:$A),4)

This Lookup table is on a sheet named - 8
The Table is 4 columns wide

With the value to be looked up in B6

=VLOOKUP(B6,rLookup,2,0) gives info in Column 2 of Lookup Table


=VLOOKUP(B6,rLookup,4,0) gives info in Column 4 of Lookup Table


Notes.
- do not have any blanks in your Lookup table
- the 4th parameter 0 means you want an exact match
- Do not put any information below Column A of the lookup Table

Revise Sheet name and references as necessary



[ This Message was edited by: Dave Patton on 2002-04-03 08:22 ]
Dave Patton is offline   Reply With Quote
Old Apr 3rd, 2002, 09:41 AM   #4
tryingexcel
New Member
 
Join Date: Apr 2002
Posts: 2
Default

The second workbook that is called in not
in the same directory as the first workbook,
so my VLOOKUP is like this:

=VLOOKUP($C$3,'[Projects.xls]My Project List'!myRange,4,FALSE)
tryingexcel is offline   Reply With Quote
Old Apr 3rd, 2002, 09:52 AM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Below is a sample of the first Workbook

FY 2001 MY Project List
PROJ NBR PROJ NAME BR NBR BR CHIEF
0176 Demographic LAN Support 18 Lau
0902 Division InterProject 02 Kreilick
0906 CPS 44 Tucker
0937 LEHD 04 Prevost


The above picked up from your edited post shows that you have text fields in your 8 columns of data.

I'll assume that the sheet that houses your data is called Data, otherwise adjust to suit, and the data start at row 2.

Activate the option Insert|Name|Define.
Enter [/b]EndRow[/b] as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=MATCH(REPT("z",20),Data!$A:$A) [ this replaces the dangerous COUNTA ]

Activate Add.
Enter [/b]LTABLE[/b] as name in the Names in Workbook box.
Enter as formula in the Refers to box:

=OFFSET(Data!$A$2,0,0,EndRow-1,8)

[ which defines a lookup table of 8 columns width ]

Activate OK.

While the WB/file is open, you can use VLOOKUP in another WB. Supposing that the first one is named/saved as MyFile.xls,

=VLOOKUP(E1,MyFile.xls!LTABLE,2,0)

should work.

Aladin




Aladin Akyurek is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes