Macro sort/hide function

UncleBose

New Member
Joined
Jun 20, 2007
Messages
25
Hello

Just wondering if there's a macro solution to a sort/hide feature I'd like to incorporate.

It's easy enough to sort "have" and "don't have," but once that's done, I'd like to hide all "don't have" rows. The problem is this list is constantly updated, and the number of "don't have" rows is always changing. One day there might be 300 "don't have" rows, and the next day there might be 350.

Also, I'd like another command to restore the list to the original setting (all items sorted and visible) from the hidden mode, so all those "don't have" rows are un-hidden and sorted with the rest.

Using Excel 2007, WinXP. Thanks!

Rich (BB code):
Excel Workbook
AB
1itemhave
2peasyes
3carrotsyes
4turnipsyes
5cabbage
6pearsyes
7bananas
8applesyes
9oranges
10tomatoes
Sheet1
Excel 2007
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I would suggest using Advanced Filtering.
Good example of Advanced Filter steps here:
http://www.contextures.com/xladvfilter01.html

AdvancedFilter Video Demo here:
http://www.contextures.com/xlVideos04.html

Another good link with sample VBA code here:
http://www.meadinkent.co.uk/xlfilter.htm

Advanced Filter allows you to preset filter options.
It also allows you to filter by criteria in ways standard autofilter can not do. You can choose an export location in the dialog box or in VBA code.
Once you setup the code and criteria, you can use a macro button to copy specific data from your main sheet to a "Report" sheet. The original data remains unchanged and the data "Filtered" to another page can be used as desired.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,275
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top