VBA help needed: Autofilter Array not working

Status
Not open for further replies.

hellfire45

Active Member
Joined
Jun 7, 2014
Messages
462
Hi guys. Based on the code below. I am trying to filter all the serial numbers in the Cust_Order_num_col that begin with a "35" or a "45" and do not contain a "/"



It seems to work except its only filtering for the second item in the array, in this was "45*". The second criteria seems to work. How do I fix it so that the first criteria looks for both items in the array?



Thanks!



Code:
Num_arr = Array("35*", "45*")

                       

       

'Filtering for Shipping entries

.Range(.Cells(1, 1), .Cells(last_row, last_col)).AutoFilter Field:=Cust_Order_num_col, Criteria1:=Num_arr, Operator:=xlAnd, Criteria2:="<>*/*", Operator:=xlFilterValues
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Status
Not open for further replies.

Forum statistics

Threads
1,216,174
Messages
6,129,297
Members
449,499
Latest member
HockeyBoi

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