Filter Problem??

brettvba

MrExcel MVP
Joined
Feb 18, 2002
Messages
1,030
Selection.AutoFilter Field:=8, Criteria1:=(<=dollarvalue), Operator:= _
xlAnd
what is wrong with the above I want to filter to less than or equal to dollarvalue
I have dim'd dollarvalue nothing seems to work help?
 
On 2002-03-14 15:11, brettvba wrote:
so what your saying mark is that you can't put a variable in a filter unless its equal to it?

You're filtering on the values in a given column. There are several choices for relatons operator: Greater than, Begins with, etc. ...Just to list a few.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
On 2002-03-14 15:12, Aladin Akyurek wrote:
On 2002-03-14 15:05, brettvba wrote:
I can do it to equal the variable by
Selection.AutoFilter Field:=8, Criteria1:=(dollarvalue), Operator:= _
xlAnd
but not less than or equal to?

Would the & trick not work -- Criteria1:="<="&E1 where E1 houses a crit value?

Aladin

Not for a recorded macro. Record one. And, see what happens.
 
Upvote 0
> Would the & trick not work -- Criteria1:="<="&E1 where E1 houses a crit value?
> Not for a recorded macro. Record one. And, see what happens.


I was thinking the straight VBA.
 
Upvote 0
On 2002-03-14 15:05, brettvba wrote:
I can do it to equal the variable by
Selection.AutoFilter Field:=8, Criteria1:=(dollarvalue), Operator:= _
xlAnd
but not less than or equal to?
[/quote]

Would the & trick not work -- Criteria1:="<="&E1 where E1 houses a crit value?

Aladin
[/quote]

Yes that should work...in brettvba's case
it would be

Criteria1:="<=" & dollarvalue

The dollarvalue being his Dim variable


Ivan
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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