Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofilter Criteria From a TextBox
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofilter Criteria From a TextBox
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 " 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet | Excel Programming | |||
AutoFilter criteria | Excel Programming | |||
AutoFilter Criteria VBA | Excel Programming | |||
Using TextBox to AutoFilter | Excel Programming | |||
VBA Autofilter Criteria | Excel Programming |