User form and macro for search function

P

Pawan

Hello

I have a workbook with several columns and rows in it. I need to create one
user form with macro which will work like this:

The form should show a drop down of all the column headings. and there
should be one (or more) text fields for entering the search criteria. If user
enters something in the criteria field and selects one column from drop down,
then the macro should find all the entries matching to the criteria and
should create a new sheet displaying all of them. e.g.

Name Country ID
John US 036
Alan AUS 035
Jason US 065

In this case, the drop down in the user form should show three columns
(Name, Country, ID). If user selects country from the drop down and writes US
in the search criteria, then the macro should create a separate sheet which
will display all the records with Country = US. The search criteria should be
able to search with *. Means if I enter *U* in search field, it should filter
all the records with U in it.

Is it possible?

Any help is highly appreciated.

Thank You

Pawan
 
D

Dave Peterson

I'm sure it's possible, but I wouldn't do it.

You're re-inventing data|filter|autofilter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top