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 19th, 2002, 08:36 AM   #1
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

How can I make my sorting macro ignore the hidden formulas?

My macro sorts fine and includes everything I want but I have extra cells for adding new data that contain a formula. When my macro sorts it places all empty cells at the top of the list then the data. When I delete the hidden formulas the sort places the empty cells at the bottom of my list like I want. Is there any way to code my macro to treat all cells that contain only the formula(not the data) as empty? The only thing the formula is, is a reference to another sheet ie. ='Sheet6'!$A$6.

Thanks,

__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Mar 19th, 2002, 08:40 AM   #2
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

Hi Viper


Push F5 and use the Edit>Go to Special - Formulas to select your formula cells, then hide the rows. Excel will not sort hiiden rows.


Dave Hawley is offline   Reply With Quote
Old Mar 19th, 2002, 08:57 AM   #3
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

test
__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Mar 19th, 2002, 09:01 AM   #4
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

Dave,
Thanks, but I do want them included in my sort. They are part of a group. So can I go at it differently? Can I change my code to sort only those in Range("A6:C10,A12:C40") <> "", or will the sort still pick up the hidden formula?
__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Mar 19th, 2002, 09:57 AM   #5
Don C
Board Regular
 
Join Date: Feb 2002
Location: Louisville, KY
Posts: 72
Default

add a space like this:
=" "&'Sheet6'!$A$6

and the formula cells should drop to the bottom of the list
Don C is offline   Reply With Quote
Old Mar 19th, 2002, 11:05 AM   #6
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

You the man!! Worked great. Is there anyway to prevent the empty cell from showing #value? I tried =IF(ISERROR(""&'Team Entry'!A5),"",""&'Team Entry'!A5) in each cell but that seemed to cancel out the space and put the empty cells on top again after sorting.

But thanks for the information.


__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Mar 19th, 2002, 11:07 AM   #7
NateO
Legend
 
NateO's Avatar
 
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
Default

(ISERROR(""&'Team Entry'!A5),"",""&'Team Entry'!A5) has no spaces in it. Try:

(ISERROR(" "&'Team Entry'!A5)," "," "&'Team Entry'!A5)
__________________
Regards,
Nate Oliver
Microsoft Excel MVP
Nate's Excel Blog
NateO is offline   Reply With Quote
Old Mar 19th, 2002, 11:44 AM   #8
viper
Board Regular
 
Join Date: Feb 2002
Location: Jefferson City, Missouri
Posts: 383
Default

Thanks Nate,

Still puts empty at top. I even did
=" " & if(iserror(" " & 'sheet'!$A$5)," "," " & 'sheet'!$A$5) but still no effect.

But thanks for all your help. I'll work on it somemore, I've got until 4/2/02 before I roll it out.


__________________
I appreciate the help from everyone at Mr. Excel.

viper
viper is offline   Reply With Quote
Old Dec 3rd, 2009, 12:07 PM   #9
wilkisa
Board Regular
 
Join Date: Apr 2002
Location: Decatur IL, USA
Posts: 494
Default Re: Can formulas be ignored?

I have the same conundrum. In cells in Column D, I have the following formula:

=IF(ISERROR(VLOOKUP(C4,$B$43:$D$73,3,FALSE)),"",VLOOKUP(C4,$B$43:$D$73,3,FALSE))

It works fine but when I sort the column, all the blanks sort to the top. So, I modified it to:

=IF(ISERROR(VLOOKUP(C4,$B$43:$D$73,3,FALSE))," "&VLOOKUP(C4,$B$43:$D$73,3,FALSE),VLOOKUP(C4,$B$43:$D$73,3,FALSE))

based on the above suggestions. I now get #N/A as a result when there is no value to pull in, which isn't a problem except that I don't want it to show as such. I went to the Page Layout tab, Page Setup, Sheets and asked that errors display as but the #N/A is still visible. I have the cells shaded using Conditional Formatting =Mod(row() so that alternating rows are white/gray. I have tried to modify the CF so that if the row has #N/A the text will go white/gray but I can't make it work either.

Does anyone have another other suggestions?
__________________
Thanks,
Shirlene
wilkisa is offline   Reply With Quote
Old Dec 3rd, 2009, 02:00 PM   #10
xenou
MrExcel MVP
Moderator
 
Join Date: Mar 2007
Location: Cleveland OH
Posts: 10,936
Default Re: Can formulas be ignored?

Perhaps your CF Criteria needs to be " #N/A" rather than "#N/A" - if we are prefixing a space to the result.

Another idea (a bad one maybe) would be to use "ZZZ" as the value for "not found" results - so it drops to the bottom of a text-sorted list. You might then use a CF to conditionally format ZZZ as White to "blend in" with the background.
__________________
Using: Office 2007/XP SP3 (work), Excel 2010/XP SP3 (home)

One is not born into the world to do everything but to do something.
-- Henry David Thoreau
xenou 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 01:18 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