Code for AutoFilter Items

mubashiraziz

Board Regular
Joined
Apr 2, 2009
Messages
175
Hi,

I am facing a problem that I am preparing a sheet which is controlling a document control record, there are different types like "in Progress", "Waiting Response" and delays like 3 Day(s) Delay, 5 Day(s) Delay, etc.

Firstly I applied this code and it worked nicely

ActiveSheet.Range("$A$3:$W$526").AutoFilter Field:=17, Criteria1:=Array( _
"17 Day(s) Delay", "5 Day(s) Delay", "In Progress", "Waiting Response"), Operator _
:=xlFilterValues


But there are lot of documents which are 17, 20, 1 , 4. 10 days delays so i used below code, which worked nicely too

ActiveSheet.Range("$A$3:$W$526").AutoFilter Field:=17, Criteria1:=Array( _
"*Delay*", "Waiting Response"), Operator:=xlFilterValues

But as soon as i enter another items "In Progress", it filter only the items of "Waiting Response" and "In Progress". it skip "**Delay*" values by not selecting them.

ActiveSheet.Range("$A$3:$W$526").AutoFilter Field:=17, Criteria1:=Array( _
"*Delay*", "Waiting Response", "In Progress"), Operator:=xlFilterValues


Can someone help me that what's wrong with this code?



Even if i use some other items like "IFC, "IFI", it still works but wild character with delay is not working. I have used "=*delay*", "*delay*" and every time its working but as soon as i select 3rd items it stops working.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Status
Waiting Response
17 Day(s) Delay
5 Day(s) Delay
8 Day(s) Delay
5 Day(s) Delay
Waiting Response
Waiting Response
Waiting Response
Waiting Response
In Progress
Waiting Response
In Progress
Waiting Response
Waiting Response

<tbody>
</tbody>

Sample Column.
 
Upvote 0

Forum statistics

Threads
1,203,525
Messages
6,055,915
Members
444,834
Latest member
ComputerExcel

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