PC Review


Reply
Thread Tools Rate Thread

Autofilter Criteria From a TextBox

 
 
farah.adila@onsemi.com
Guest
Posts: n/a
 
      6th Mar 2007
I would like my prog retrieves from a worksheet based on what users
input in a textbox.

look_for = Workbooks("CONTRACT").Sheets("Advanced Find").Cells(9,
3).Value
Range("C3").AutoFilter Field:=3, Criteria1:=look_for, Operator:=xlAnd


Instead of having the exact look_for, I want the program to retrieve
any words contain from the look_for. Tried to use
Criteria1:="*look_for*" but the program will certainly filter for
words look_for.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      6th Mar 2007
Hi Farah -

Convert the look_for variable into a valid criterion for the Autofilter's
Criteria1 argument: look_for = "=*" & look_for & "*".

look_for = Workbooks("CONTRACT").Sheets("Advanced Find").Cells(9,
3).Value
look_for = "=*" & look_for & "*".
Range("C3").AutoFilter Field:=3, Criteria1:=look_for, Operator:=xlAnd

--
Jay


"(E-Mail Removed)" wrote:

> I would like my prog retrieves from a worksheet based on what users
> input in a textbox.
>
> look_for = Workbooks("CONTRACT").Sheets("Advanced Find").Cells(9,
> 3).Value
> Range("C3").AutoFilter Field:=3, Criteria1:=look_for, Operator:=xlAnd
>
>
> Instead of having the exact look_for, I want the program to retrieve
> any words contain from the look_for. Tried to use
> Criteria1:="*look_for*" but the program will certainly filter for
> words look_for.
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoFilter Criteria in VBA =?Utf-8?B?QWJoaQ==?= Microsoft Excel Programming 5 25th Apr 2007 05:37 PM
How do I use a Userforn TextBox with Autofilter woodie_uk Microsoft Excel Programming 0 14th Feb 2007 01:10 PM
Selection.AutoFilter Field / Criteria => criteria sometimes non-existing on worksheet markx Microsoft Excel Programming 1 24th Nov 2006 02:52 PM
AutoFilter Criteria VBA =?Utf-8?B?RXN0aGVySg==?= Microsoft Excel Programming 2 20th Aug 2004 12:54 PM
Using TextBox to AutoFilter salihyil Microsoft Excel Programming 4 16th Feb 2004 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:16 AM.