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 15th, 2002, 07:05 AM   #1
Louis
New Member
 
Join Date: Apr 2002
Posts: 11
Default

Can anyone help me with the following problem?

I have a large workbook with on one sheet a table with an autofilter. When I use this autofilter to select certain records or when I sort it, the whole workbook is recalculated (it turns out that sorting/filtering triggers the recalculation). This takes quite a long time, while it is not necessary. How can I get round this problem?

Possible solutions:
- set the calculation mode to manual...but I still want to calculate some cells (eg the SUBTOTAL formulas on the same sheet)...
- use of the calculate event...but I can only avoid recalculation of the whole workbook by entering code that sets the calculation mode to manual, but then it won't update anything anymore and also the calculate event won't be triggered in the future...
- use of the filter or sort event...but it does not exist (?)...

The problem does not seem too difficult, but I still have not been able to solve it.
Louis is offline   Reply With Quote
Old Apr 15th, 2002, 07:45 AM   #2
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Hi
Depending on how many different cells you are wanting to calculate along with the filter, you may want to try this.
Place a button on your sheet which will disable calculation for the entire application. Perform your filtering. Then on another button, a macro which selectively calculates your chosen ranges and will also re-enable calculation altogether.
If your autofilter performs the same operation with the same parameters each time, you could just automate the whole process into one procedure if you like.
Am I understanding you?
Thanks,
Tom
Tom Schreiner is offline   Reply With Quote
Old Apr 15th, 2002, 08:00 AM   #3
Louis
New Member
 
Join Date: Apr 2002
Posts: 11
Default

TsTom, thanks for answering!

If you use "xlcalculationmanual" and "xlcalculationautomatic" to disable and enable calculation it will finally recalculate the whole workbook anyway, when clicking the second button (or is this not what you mean?).

Moreover, to keep the sheet user-friendly, it is not preferable to ask the user to click one or two buttons whenever he sorts or autofilters.

But thanks for helping me further with your solution.
Louis is offline   Reply With Quote
Old Apr 15th, 2002, 01:00 PM   #4
Louis
New Member
 
Join Date: Apr 2002
Posts: 11
Default

Maybe I should rephrase my question into a more general one:

Are the default events as defined by visual basic (beforedoubleclick, open, change etc.) the only ones available or is it possible to add new ones yourself in some way? In my case, is there a way to trap an autofilter event or a sort event?

Thanks
Louis is offline   Reply With Quote
Old Yesterday, 01:33 PM   #5
UHsoccer
Board Regular
 
Join Date: Apr 2002
Location: Detroit
Posts: 792
Default Re: Recalculate after filter/sort

How does one "selectively calculate" formulas?
__________________
Excel 2003 and 2007 on XP as well as Excel 2010 on 64bit Windows-7
UHsoccer 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:14 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