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 Mar 8th, 2002, 06:20 AM   #1
GBOB
New Member
 
Join Date: Mar 2002
Posts: 17
Default

Hi all,

Posting this again, please tell me if the question is not clear.

I have created a userform that dumps data into a named range. Each time I add new data the data range is increased by one row. To the right of the data range I have a number of formulas that perform functions on the particular data range row. My problem is that when I am editing my data entries and I delete an entry therefore deleting a row in my data range all of the formulas to the right of the row turn into #REF! permanently, is there any way to stop this?

Thanks!
GBOB is offline   Reply With Quote
Old Mar 8th, 2002, 02:35 PM   #2
Damon Ostrander
MrExcel MVP
 
Damon Ostrander's Avatar
 
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
Default

Hi GBOB,

You have deleted the cells that the formulas reference, so naturally the formulas no longer give a valid result. But you didn't mention what you want them to do. How should they accommodate to the fact that their data is now missing? Do you want them to now reference the cells that have moved up to replace the deleted cells? Or perhaps you want to delete the formulas? Or maybe you want to leave the formulas there but want them to yield a blank rather than an error?
__________________
Keep Excelling.

Damon

VBAexpert Excel Consulting
(My other life: http://damonostrander.com )
Damon Ostrander is offline   Reply With Quote
Old Mar 9th, 2002, 04:00 PM   #3
GBOB
New Member
 
Join Date: Mar 2002
Posts: 17
Default

Hi Damon,

Thank you for the response. I would like the formulas to now reference the cells that have moved up to replace the old cells that were deleted. Any thoughts?

Thanks!
GBOB is offline   Reply With Quote
Old Mar 11th, 2002, 06:20 AM   #4
GBOB
New Member
 
Join Date: Mar 2002
Posts: 17
Default

Any thoughts?
GBOB is offline   Reply With Quote
Old Mar 11th, 2002, 01:39 PM   #5
Damon Ostrander
MrExcel MVP
 
Damon Ostrander's Avatar
 
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
Default

Hi again GBOB,

Okay, say your range that contains the cell you are deleting is A1:A100 and the range that contains formulas dependent on this data is in B1:B100. To re-align all the formula references, simply use the FillDown method:

Sheets("MySheet").[B1:B100].FillDown

If you don't know where the data in the B column ends (perhaps because you are constantly adding or deleting rows), simply use:

With Sheets("MySheet")
.Range(.[B1],.[B65536].End(xlUp)).FillDown
End With

If the sheet is the active worksheet, then this becomes just:

Range([B1],[B65536].End(xlUp).FillDown

Simply apply this general idea to whatever ranges your data are in.
__________________
Keep Excelling.

Damon

VBAexpert Excel Consulting
(My other life: http://damonostrander.com )
Damon Ostrander is offline   Reply With Quote
Old Mar 12th, 2002, 06:06 AM   #6
GBOB
New Member
 
Join Date: Mar 2002
Posts: 17
Default

Damon,

Thanks so much, works great!

GBOB 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 06:57 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