Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selection.AutoFilter Field represented by "all"
In a Selection.AutoFilter Field is there a way to have Criteria1 represent
"all"? For example, Selection.AutoFilter Field:=4 alone will represent "all" and Selection.AutoFilter Field:=4, Criteria1:=Price will select based on the price. I have set up a Userform so that "all" could be represented by "0" in the string variable Price. But I would preferred to have it represented by "all" in some form when the textbox is left blank. I could figure out some code that the ", Criteria1:=Price" is added after Selection.AutoFilter Field is added but that seems to be going overboard. Thanks, Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selection.AutoFilter Field represented by "all"
Jeff,
This seems to work fine: If Price = "0" Or Price = "" Then Selection.AutoFilter Field:=4 Else Selection.AutoFilter Field:=4, Criteria1:=Price End IF HTH, Bernie Excel MVP "JeffFinnan" wrote in message ... In a Selection.AutoFilter Field is there a way to have Criteria1 represent "all"? For example, Selection.AutoFilter Field:=4 alone will represent "all" and Selection.AutoFilter Field:=4, Criteria1:=Price will select based on the price. I have set up a Userform so that "all" could be represented by "0" in the string variable Price. But I would preferred to have it represented by "all" in some form when the textbox is left blank. I could figure out some code that the ", Criteria1:=Price" is added after Selection.AutoFilter Field is added but that seems to be going overboard. Thanks, Jeff |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selection.AutoFilter Field represented by "all"
Bernie,
Yeah, I guess I will have to resort to this type of conditional phrasing. I was hoping that there might be some simpler trick. Thanks, Jeff If Price = "0" Or Price = "" Then Selection.AutoFilter Field:=4 Else Selection.AutoFilter Field:=4, Criteria1:=Price End IF |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Pivot Tables - How can I "reset" the selections in "Row Field"? | Excel Discussion (Misc queries) | |||
what does the symbol "^" mean and how can it be represented in a f | Excel Worksheet Functions | |||
Icon for "Wrap" and for "Centre Across Selection" | Excel Worksheet Functions |