I am looking to reverse lookup data entered via a form. I have a button to transfer data from the form into a table, VBA code as below, if there is a way of adapting this code:
Sub data_input()
ws_output = "Shelf Stock Data"
next_row = Sheets(ws_output).Range("A" & Rows.Count).End(xlUp).Offset(1).Row
Sheets(ws_output).Cells(next_row, 1).Value = Range("staff_name").Value
Sheets(ws_output).Cells(next_row, 2).Value = Range("supplier").Value
Sheets(ws_output).Cells(next_row, 3).Value = Range("signed").Value
Sheets(ws_output).Cells(next_row, 4).Value = Range("po_number").Value
Sheets(ws_output).Cells(next_row, 5).Value = Range("roll_length").Value
Sheets(ws_output).Cells(next_row, 6).Value = Range("roll_width").Value
Sheets(ws_output).Cells(next_row, 7).Value = Range("shelf_location").Value
Sheets(ws_output).Cells(next_row, 8).Value = Range("date").Value
Sheets(ws_output).Cells(next_row, 9).Value = Range("in_out").Value
Sheets(ws_output).Cells(next_row, 10).Value = Range("notes_comments").Value
MsgBox "Submitted - Please clear the workbook before you save"
End Sub
I am now trying to retrieve this information that is stored in rows and repopulate the form fields, to enable quick editing of stock movements, by searching the "po_number".
The end-users are very computer illiterate, so a simple button and search bar is the best solution.
The data table will potentially have multiple entries for the same "po_number", so would it be possible to only display the latest entry for the search result?
Thank you for any help you can offer.