Search then add information

kapps813

New Member
Joined
Feb 5, 2022
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
New to userforms.
Looking to add a function to a command button that will "Search" for an existing serial number listed in table1 (column D), then display combined values from two other cells (column B & C) into one locked textbox "Manufacturer/Model" for verification.
Using a second "Add" command button within the same userform, allow me to add/edit data in the same row as the found Serial Number into columns J (Date), K (Name), L (Address), M (Notes).

Thanks for the help
 

Attachments

  • Screenshot 2022-02-05 145312.jpg
    Screenshot 2022-02-05 145312.jpg
    74.9 KB · Views: 11

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Should be as simple as:
VBA Code:
For Each cell in ThisWorkbook.Sheets("Your Sheet Name").Range("D:D").Cells
        If cell = TxtNameOfYourSerialNumberTextbox then
                  Manufacturer/Model.text = cell.offset(,-2) & cell.offset(,-1)
                  Exit For
        End If
        If cell = "" then Exit For
I am doing this out of a user form as I don't want to create one but if you get an issues let me know
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

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