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 1st, 2002, 10:43 AM   #1
aaron_brown99
New Member
 
Join Date: Mar 2002
Location: Global Crossing
Posts: 20
Default

I have a range named "database" that I add to using the built-in data form, and it updates the range when I enter new records.
However, sometimes I need to add records by importing rows from another spreadsheet (hundreds at a time). Is there a way to have the named range extend automatically when I paste rows in like this?
aaron_brown99 is offline   Reply With Quote
Old Apr 1st, 2002, 10:48 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-01 09:43, aaron_brown99 wrote:
I have a range named "database" that I add to using the built-in data form, and it updates the range when I enter new records.
However, sometimes I need to add records by importing rows from another spreadsheet (hundreds at a time). Is there a way to have the named range extend automatically when I paste rows in like this?
What is the current exact range Database refers to? Would you also enumerate the type of data that you have in that range such as dates, numbers, etc.?
Aladin Akyurek is offline   Reply With Quote
Old Apr 1st, 2002, 10:50 AM   #3
lenze
MrExcel MVP
 
lenze's Avatar
 
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
Default

Don't know if this will work or not, but try inserting rows in your table above the last record and copying the new rows inside the database. BUT a better way is to use a Dynamic Named Range. If you search the board, you should find several references of how to do this
lenze is offline   Reply With Quote
Old Apr 1st, 2002, 10:52 AM   #4
aaron_brown99
New Member
 
Join Date: Mar 2002
Location: Global Crossing
Posts: 20
Default

The current "Database" range is: $A$1:$E$316.

I'm storing inbound call center call volume and answer speed information. Each record includes a date, two number fields, a custom time field ([h]:mm:ss) and a text field for identifying the inbound skillset.
aaron_brown99 is offline   Reply With Quote
Old Apr 1st, 2002, 11:03 AM   #5
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-01 09:52, aaron_brown99 wrote:
The current "Database" range is: $A$1:$E$316.

I'm storing inbound call center call volume and answer speed information. Each record includes a date, two number fields, a custom time field ([h]:mm:ss) and a text field for identifying the inbound skillset.
Assuming that column A houses the dates,

[1] activate the option Insert|Name|Define,
[2] enter EndRow as name in the Names in the Workbook box,
[3] enter as formula in the Refers to box:

=MATCH(9.99999999999999E+307,x!$A:$A)

[ Note. Replace 'x' by the sheetname where the database is. ]

[4] Activate Add,
[5] Enter Database as name in the Names in Workbook box,
[6] Enter as formula in the Refers to box:

=OFFSET(x!$A$1,0,0,EndRow,5)

[ Note. Replace 'x' by the sheetname where the database is. ]

[7] Activate OK.

Now, you're ready to use the dynamic range name, Database in your workbook. It will expand or shrink automatically along with deletions from or the additions to the data area.


Aladin Akyurek is offline   Reply With Quote
Old Apr 1st, 2002, 11:16 AM   #6
aaron_brown99
New Member
 
Join Date: Mar 2002
Location: Global Crossing
Posts: 20
Default

Beautiful, it works great!

Unless I'm mistaken, I noticed in the OFFSET formula you reference "5" as the width. IF I later add a column (not likely) to the database, will I need to update the width as well?

Thanks again, this now allows me to COMPLETELY automate my inputs with VB and will save me hours each week!
aaron_brown99 is offline   Reply With Quote
Old Apr 1st, 2002, 11:21 AM   #7
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-01 10:16, aaron_brown99 wrote:
Beautiful, it works great!

Unless I'm mistaken, I noticed in the OFFSET formula you reference "5" as the width. IF I later add a column (not likely) to the database, will I need to update the width as well?

Thanks again, this now allows me to COMPLETELY automate my inputs with VB and will save me hours each week!
Yes, 5 refers to the width.

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 10th, 2002, 12:55 AM   #8
stevesian
New Member
 
Join Date: Apr 2002
Posts: 9
Default

Aladin this is brilliant.

I tried this myself, per your instructions and increasing the ‘5’ in the original example to ‘31’ (my number of columns).

The resulting database named range is the correct number of columns wide, but it is 4 rows too long.

This creates another bug for me, which is why I want my named range to be exact:

My data range is an external data text file, so it will change all the time.
The current range is $A$5:$AE$1291.

Your DATABASE range calculates out to $A$5:$AE$1295 for some reason. Can you help?

The whole reason for setting the EXACT data range is for the pivot tables I have created from this data range with DATE fields in them: I cannot group the date fields at all, unless the data range is EXACT with no blanks. Don’t ask me why. I found this out by trial-and-error, certainly not through Microsoft resources.

Can you help? Everything in my spreadsheet is automated except this. I’m posting this as well. if you can, you are a god…

Sincerely,
Steve Sian
Vancouver, BC
stevesian is offline   Reply With Quote
Old Apr 10th, 2002, 01:41 AM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-09 23:55, stevesian wrote:
Aladin this is brilliant.

I tried this myself, per your instructions and increasing the ‘5’ in the original example to ‘31’ (my number of columns).

The resulting database named range is the correct number of columns wide, but it is 4 rows too long.

This creates another bug for me, which is why I want my named range to be exact:

My data range is an external data text file, so it will change all the time.
The current range is $A$5:$AE$1291.

Your DATABASE range calculates out to $A$5:$AE$1295 for some reason. Can you help?

The whole reason for setting the EXACT data range is for the pivot tables I have created from this data range with DATE fields in them: I cannot group the date fields at all, unless the data range is EXACT with no blanks. Don’t ask me why. I found this out by trial-and-error, certainly not through Microsoft resources.

Can you help? Everything in my spreadsheet is automated except this. I’m posting this as well. if you can, you are a god…

Sincerely,
Steve Sian
Vancouver, BC
Steve,

Use in your OFFSET formula

EndRow-4

instead of just

EndRow.

The reason for this is that your data start at row 5 (to be seen from $A$5).

Aladin
Aladin Akyurek is offline   Reply With Quote
Old Apr 28th, 2002, 04:38 PM   #10
stevesian
New Member
 
Join Date: Apr 2002
Posts: 9
Default

Aladdin or others: can you help me again?

The first instance of this dynamic named range works flawlessly.

I tried to do it in the same workbook but with a different range.

Since I used DATABASE and ENDROW the first time, I created the following two new names, to reference the table in my Remaining Limits sheet:

EndRowLimits:
=MATCH(9.99999999999999E+307,'Remaining Limits'!$A:$A)

DatabaseLimits:
=OFFSET('Remaining Limits'!$A$9,0,0,EndRowLimits-8,10)

The range I want to use begins on A9 and is 10 columns wide. The first column A contains formulas. It is a continguous data table (all cells are full of something).

I copied the formulas for all four name ranges to cells. The original MATCH function correctly evaulates and returns a number (last row in the original table). The new MATCH function does not evaluate and returns a #N/A.

Consequently, the DatabaseLimits name range formula can't, I guess, evaluate off an invalid EndRowLimits name range formula.

Anyways: your suggestions are appreciated.

I tried deleted all above rows and making the data range start at $a$1, didn't help (and not desireable). Tried killing the first column, since it contains formulas, not values, didn't help).

Please help!

Thank you.


[ This Message was edited by: stevesian on 2002-04-28 15:49 ]
stevesian 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 12:58 PM.


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