PDA

View Full Version : Creating a userform to perform a search function



teaaddict
07-31-2009, 09:28 AM
Hi

I have created an Excel spreadsheet which has several columns listing a number of variables e.g. location, hours per week etc.

I've also created the basics of a userform which has a number of boxes to input the variables and a command button which when clicked needs to:

- search for a match of ALL entered variables within the columns on the spreadsheet
- when it finds a match(es), it then extracts the information provided in another column and displays this in a message box
- if it doesn't find a match which satisfies all the variables entered the message box displays an unsuccessful message

If anyone has any idea how to make this work it would be much appreciated!

Cheers

Jess

p45cal
07-31-2009, 09:49 AM
You'll get the quickest response by supplying (cut down/adjusted version if too much/too sensitive data) a workbook of where you've got so far, to save people answering your question having to reconstruct for themselves what you describe.

Benzadeus
07-31-2009, 10:47 AM
- when it finds a match(es), it then extracts the information provided in another column and displays this in a message box


How do you will display in another column the matches of a multiple criteria search? Didn't you mean in another sheet?

Benzadeus
07-31-2009, 11:25 AM
See attachment (sugestion).

teaaddict
07-31-2009, 02:32 PM
Hi

Thanks for your suggestion, you've nearly got the idea. Apologies, I should've provided an example of what I meant:

A B C D E code description
1 4 4 6 7 XYZ abc
6 9 2 4 6 TGH bht
8 5 4 2 8 TYH uye
6 9 2 4 9 UKJ thj

I have the variables A-E which I would like to enter into the userform. When I click the find button I want it to perform a search of the variables A-E and find a match for all variables.

I then want the corresponding code and description for the match(es) to be displayed in a message box or a box within the userform. If no matches are found a message box displaying 'no matches found' would pop up.

Hope that clarifies things a bit.

Cheers

Jess

Benzadeus
08-03-2009, 04:34 AM
See attach.