advanced filter will only work for one criterion

daveyc18

Well-known Member
Joined
Feb 11, 2013
Messages
782
Office Version
  1. 365
  2. 2010
for some reason, the advance filter only works for one criterion...when i try to expand the range...it stops working...

e.g im only filtering for

OSP
397

if i add another column

OSP
400


the advanced filter via VBA stops working (just shows blank).....yes, I have modified the named range to capture the additional column...this is driving me nuts
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
You can put all your VBA code, an example of your data and an example of the criteria
 
Upvote 0
update

if i add just one "OSP" column and then add another filter column

Quantity
>=1000000


the advanced filter works...but the momemnet I add another "OSP" column, it stops working
 
Upvote 0
You can put all your VBA code, an example of your data and an example of the criteria


Range("A1:AA" & finalrow).AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=Range("test")



again, when "test" consists of...

OSP
397

another column

Quantity
>=1000000


...the advanced filter works fine


OSP
397

another column

OSP
400


the advanced filter doesn't work for multiple "OSP" headers...the source data definitely has it........what is going on here?
 
Upvote 0
Sorry but I can not help you if you do not put an example of your data

And what are you waiting for?
 
Last edited:
Upvote 0
Do you want me to filter those that are equal to 397 or equal to 400?

It does not go in another column they go down:

[TABLE="class: grid, width: 76"]
<tbody>[TR]
[TD="width: 76, align: center"]OSP[/TD]
[/TR]
[TR]
[TD="align: right"]397[/TD]
[/TR]
[TR]
[TD="align: right"]400[/TD]
[/TR]
</tbody>[/TABLE]

Expand your test range from the title "OSP" to the row with the data 400
 
Upvote 0
As DanteAmor alluded to

Adding criteria columns adds those criteria with an AND.
Adding criteria rows adds those criteria with an OR.
 
Last edited:
Upvote 0
arlight i have another problem

this is how my advance filter is set up

column A = acct #

column B = quantity

column C = value

column D = ID


each account # has the same criteria ....quantity >=10, value = 0....the "ID" column (column D) is blank because i need to capture all the IDs

the only exception is account #217...I still want quantity >=10, value = 0., BUT I want to EXCLUDE any IDs that start with "8," "9," "B", "X", and "T."

i tried to entering multiple rows for 217, each row having a different exclusion in column D (e.g., one row is "<>8*", another row is "<>*9), but it doesn't work.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

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