Using text input box to call cell values.

mrmatt36

New Member
Joined
Nov 27, 2024
Messages
6
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Looking for info on how to create a text input box on a new sheet that will allow user to input a part number hit a button and have it search data on another sheet and retrieve/display the data related to this item from the other cells.

example- sheet one will have all the part information, column a on sheet one will have the part number, column b will have part name, column c will have part vendor, column d will have the location.
sheet 2 will simply have a text input box with a label - "Input part number to lookup" then have a button "lookup" or "reset" reset will just clear the text box, when you hit lookup it will search column a on sheet one for a match, if matching part number is found it will populate the data for this part from columns a, b, c,& d from sheet one to information box on sheet 2 (same sheet where part number is entered). the text input box and the populated information should be on fixed fields on sheet 2 not a popup box.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to the forum.

Does it have to be text boxes? You can do all of that with formulas on the sheet except for the clear/reset button.
 
Upvote 0
This is what i am going for: Sheet 2 would be the default sheet when opening the file.

sh2blank.png

sht2_filled.png


this data would be pulled from sheet 1

sht1.png
 
Upvote 0
Welcome to the forum.

Does it have to be text boxes? You can do all of that with formulas on the sheet except for the clear/reset button.
Thanks,
I suppose if what I am after is obtainable just with formulas on the sheet itself, I am not opposed to it. If you can provide some insight on this I can give it a try and see how it works.

Thanks in advance.
 
Upvote 0
Yeah, give this a try. I didn't do anything to add "clear" functionality. All you have to do it delete the entry in the input box (C7).

Book1
ABCD
1Part NumberPart NameVendorLocation
2555311/4" stainless washernational stainless productsBox 42
3555325/16" stainless washernational stainless productsBox 43
4555333/8" stainless washernational stainless productsBox 44
5555341/2" stainless washernational stainless productsBox 45
6555351" drywall screwsgrip rite fastenersBay 3 - #13
7555361-1/4" drywall screwsgrip rite fastenersBay 3 - #14
8555371-5/8" drywall screwsgrip rite fastenersBay 3 - #15
9555386-32 x 3/4" machine screwsnational toolingShelf 23
10555396-32 x 1" machine screwsnational toolingShelf 24
Sheet1

Book1
ABCDEFGHIJ
1
2John's Hardware
3Part Lookup
4
5
6Part Number
7Clear
8
9
10
11
12Part Number: 
13
14Part Name: 
15
16Vendor: 
17
18Location: 
19
Sheet2
Cell Formulas
RangeFormula
E12E12=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$A$2:$A$10,"")
E14E14=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$B$2:$B$10,"")
E16E16=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$C$2:$C$10,"")
E18E18=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$D$2:$D10,"")
 
Upvote 0
That seems to work. is there a way to have a response if the number input is not found on sheet 1? "item not found" "check part number and try again" something to that affect? Also if there away when it grabs the data from a cell from sheet 1 if data matches certain words to change them on the display? IE way to mask the vendor info. Item 55533 vendor = national stainless products. could we make it so it would respond to sheet 2 with "vendor #1", if value = grip rite fasteners then respond with vendor = Vendor #2 etc.

 
Upvote 0
This would be the easiest way to mask the vendors by adding a new column to sheet 1 with the desired values:
Book1
ABCDE
1Part NumberPart NameVendorLocationVendor Mask
2555311/4" stainless washernational stainless productsBox 42Vendor #1
3555325/16" stainless washernational stainless productsBox 43Vendor #1
4555333/8" stainless washernational stainless productsBox 44Vendor #1
5555341/2" stainless washernational stainless productsBox 45Vendor #1
6555351" drywall screwsgrip rite fastenersBay 3 - #13Vendor #2
7555361-1/4" drywall screwsgrip rite fastenersBay 3 - #14Vendor #2
8555371-5/8" drywall screwsgrip rite fastenersBay 3 - #15Vendor #2
9555386-32 x 3/4" machine screwsnational toolingShelf 23Vendor #3
10555396-32 x 1" machine screwsnational toolingShelf 24Vendor #3
Sheet1

Book1
ABCDEFGH
1
2John's Hardware
3Part Lookup
4
5
6Part Number
755537
8
9
10
11
12Part Number:55537
13
14Part Name:1-5/8" drywall screws
15
16Vendor:Vendor #2
17
18Location:Bay 3 - #15
19
Sheet2
Cell Formulas
RangeFormula
E12E12=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$A$2:$A$10,IF(C7="","","Item Not Found"))
E14E14=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$B$2:$B$10,IF(C7="","","Item Not Found"))
E16E16=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$E$2:$E$10,IF(C7="","","Item Not Found"))
E18E18=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$D$2:$D10,IF(C7="","","Item Not Found"))


And try this for the "item not found" message:
Book1
ABCDEFGH
1
2John's Hardware
3Part Lookup
4
5
6Part Number
74485
8
9
10
11
12Part Number:Item Not Found
13
14Part Name:Item Not Found
15
16Vendor:Item Not Found
17
18Location:Item Not Found
19
Sheet2
Cell Formulas
RangeFormula
E12E12=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$A$2:$A$10,IF(C7="","","Item Not Found"))
E14E14=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$B$2:$B$10,IF(C7="","","Item Not Found"))
E16E16=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$C$2:$C$10,IF(C7="","","Item Not Found"))
E18E18=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$D$2:$D10,IF(C7="","","Item Not Found"))


Or this if you don't want the message repeated in each field:
Book1
ABCDEFGH
1
2John's Hardware
3Part Lookup
4
5
6Part Number
755579
8
9
10
11
12Part Number:Item Not Found
13
14Part Name: 
15
16Vendor: 
17
18Location: 
19
Sheet2
Cell Formulas
RangeFormula
E12E12=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$A$2:$A$10,IF(C7="","","Item Not Found"))
E14E14=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$B$2:$B$10,"")
E16E16=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$E$2:$E$10,"")
E18E18=XLOOKUP(C7,Sheet1!$A$2:$A$10,Sheet1!$D$2:$D10,"")
 
Upvote 0
The problem with that is the data on sheet one is often updated and includes hundreds of different vendors. the data on sheet one is also supplied from a different department without that column or masking.
 
Upvote 0
The problem with that is the data on sheet one is often updated and includes hundreds of different vendors. the data on sheet one is also supplied from a different department without that column or masking.
Then you could use a separate table with unique vendor names and their masks. Then all you would have to do is update that list. Or we could potentially make that a more automatic process too.
 
Upvote 0
That seems to work. is there a way to have a response if the number input is not found on sheet 1? "item not found" "check part number and try again" something to that affect? Also if there away when it grabs the data from a cell from sheet 1 if data matches certain words to change them on the display? IE way to mask the vendor info. Item 55533 vendor = national stainless products. could we make it so it would respond to sheet 2 with "vendor #1", if value = grip rite fasteners then respond with vendor = Vendor #2 etc.

If Vendor data needs to be masked, why not remove the Vendor Textbox?
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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