Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a 10,000 row parts catalog worksheet, with columns for parts #, part location, and description. I want to filter the description column based on the what the user enters in a user form. I am having some trouble doing this though. Here is some code I tried (from recording a macro), where "input1" and "input2" are what I have named the text box values in the user form that the user enters the search criteria. Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:="=*input1*", Operator:=xlAnd, _ Criteria2:="=*input2*" What is actually happening when I use this code is that the column is being filtered by the actual words input1 and input2, as opposed to being filtered by the userform textbox values that I assigned to the names input1 and input2. Any help on how to fix this would be greatly appreciated. Also, if anyone has suggestions on maybe a better method to search or filter a catalog, using a very easy and simply user interface, it would be awesome. Thanks, Kyle -- kylec ------------------------------------------------------------------------ kylec's Profile: http://www.excelforum.com/member.php...o&userid=35541 View this thread: http://www.excelforum.com/showthread...hreadid=553041 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=*" & input1 & "*", Operator:=xlAnd, _ Criteria2:="=*" & input2 & "*" -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "kylec" wrote in message ... I have a 10,000 row parts catalog worksheet, with columns for parts #, part location, and description. I want to filter the description column based on the what the user enters in a user form. I am having some trouble doing this though. Here is some code I tried (from recording a macro), where "input1" and "input2" are what I have named the text box values in the user form that the user enters the search criteria. Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:="=*input1*", Operator:=xlAnd, _ Criteria2:="=*input2*" What is actually happening when I use this code is that the column is being filtered by the actual words input1 and input2, as opposed to being filtered by the userform textbox values that I assigned to the names input1 and input2. Any help on how to fix this would be greatly appreciated. Also, if anyone has suggestions on maybe a better method to search or filter a catalog, using a very easy and simply user interface, it would be awesome. Thanks, Kyle -- kylec ------------------------------------------------------------------------ kylec's Profile: http://www.excelforum.com/member.php...o&userid=35541 View this thread: http://www.excelforum.com/showthread...hreadid=553041 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prompt user for input and utilize that input | Excel Worksheet Functions | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
autofilter using string input | Excel Programming | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming | |||
Autofilter input | Excel Programming |