Lookup data from two textboxes on a userform

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am looking for a script that will lookup data from my database based on the data entry in two textboxes.

I will enter data into the two textboxes then when I click the lookup button, I want it scan through the column containing the data and see if it can find those data in the two textboxes in database in such a way that they are in succession.

Now let me be clear here:

The data will be numbers in formats like;

01-02-03-04-05 and 06-07-08-09-10 these are the textbox entries

So look into the database and see if there is say;

60-02-43-20-03 in textbox1 and 06-07-11-32-70 in textbox2 . The order of the numbers does not matter. All that matters is that they are in succession with the data from first textbox on top and second textbox data below it. And also at least two numbers appear in each case.

I just wish it could be possible to do so.

So when the match is found, I will like to output the data to other textboxes. Here, there will be three of such:

1. To display match for textbox1
2. To display match for textbox 2
3. To display data below the display in the point (2) above


Since the database is a bit long, the match might be numerous a bit. That's there may be multiple matches. So in such cases, I will like to toggle between the result back and forth only if this is achievable.

I don't know if I should use message box instead of the textbox for the output display.


Let's take the data column to be B

I need your help, advice and others.

Thanks in advance
Kelly
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Still need help with this. If what I wanna do is not possible, then I will be glad if anyone here can suggest a cool way for me.

Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,964
Messages
6,175,659
Members
452,666
Latest member
AllexDee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top