![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 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? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Shouldn't criteria be a cell range consider of no less that 2 rows?
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
It was recorded code I want to filter by a specified dollar amount eg $100 using a variable any other code would be of help?
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Ahh, sorry thought this was an Advanced AutoFilter. Is Field 8 your dollar amount field? You should be entering <=100.
Selection.AutoFilter Field:=8, Criteria1:="<=100", Operator:=xlAnd [ This Message was edited by: Mark W. on 2002-03-14 15:04 ] |
|
|
|
|
|
#5 | |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
Quote:
Selection.AutoFilter Field:=8, Criteria1:="<=dollarvalue" |
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
that would work for text but i'm putting a variable in their, this is an autofilter thats being customised.
|
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
|
|
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
I can do it to equal the variable by
Selection.AutoFilter Field:=8, Criteria1:=(dollarvalue), Operator:= _ xlAnd but not less than or equal to? |
|
|
|
|
|
#9 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
so what your saying mark is that you can't put a variable in a filter unless its equal to it?
|
|
|
|
|
|
#10 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
Aladin |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|