Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[excel vba] search form with 2 criteria

Status
Not open for further replies.

p27br

Programmer
Aug 13, 2001
516
GB
hello

I need to do the following : I have an excel workbook with one worksheet. The first column is populated with data.
the user wants to generate a new sheet in this workbook with only the records from the first sheet containing the matching criteria.

I have setup a user form with 2 textboxes for the search criteria, and 2 checkboxes so that the user can choose criteria1 and/or criteria2

could someone help me write the procedure that searches the records and outputs the result to the new worksheet ?

thanks a lot
 


Hi,

You could use Data/Get External Data/New Database Query and set up a simple parameter query. Could be done with no VB code at all.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
As a starting point you may use the macrorecorder when you manually set an AutoFilter or an Advancedfilter.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
skipvought

good idea, but when i select the workbook in the new database query wizard, it says " This data source contains no visible tables
 


Select the [Options] button in the Add Tables window and check ALL the boxes.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
thanks

it seems to work now i checked system tables :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top