LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Using Autofilter with User Input

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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prompt user for input and utilize that input ninner Excel Worksheet Functions 2 March 28th 07 09:44 PM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
autofilter using string input KT[_3_] Excel Programming 3 October 28th 04 02:42 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM
Autofilter input Abdul Salam Excel Programming 1 August 11th 03 02:41 PM


All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"