Advanced Filter Command Buttons

RobLmrcpvf

New Member
Joined
Jun 16, 2011
Messages
4
Hi, I've been experimenting with some command buttons that run the features of Advanced Filter/Clear. I recorded the macro, and clicked the features to save code to store on a command button. I have 2 buttons for each procedure, one for Filter, one for Clear Filter.

This process works well most of the time, but occassionally the search seems to freeze and/or I get an error message to end/debug. Also, the command buttons only seem like they could be built for and searches, and that the or operators do not work. If we include coding for blank rows to cover potential or operators, then the advanced filter button does nothing because it sees a blank row as all records, I believe. Perhaps there could be an if statement to fix this.

My data I'm searching through, not sure if it matters, is external data tables or queries from Access. It consists of material, inventory, and cost. There are class fields, part number fields, description fields, and cost and inventory. I will be searching everything but cost and inventory.

I need some help in getting some code that will not freeze the filter, as well as allow potential or operator searches. I feel that the recording of a macro and applying to the button just isn't the bottom line on what the code should look like. I need a smooth transition to filter once, filter again without clearing, and again and again, and then maybe clear if need be. This keyword filtering is very similar to the system we use at work, and is the reason I need it done this way. I also have folks not interested in auto-filter. I need something similar and requires almost absolutely no learning. I'm almost there! I just need help from someone on writing the correct code. Thanks!
<!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Pffft what? You should read it and understand the frustration people have gone through with trifles like that. Don't be so quick to blow it off.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,837
Members
449,471
Latest member
lachbee

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