VBA Similar to VLookup for Editing Data in Worksheet

Makpo

New Member
Joined
Sep 23, 2011
Messages
28
Hi,

Am new to vba and I need help the userform I just created to edit my table similar to a search. I already have a userform that populates this table. The table is shown below;

However, on the this new userform (frmEdit), I have a combobox with a drop down for Products and other textboxes for the other columns (PartID, Location, Date and Quantity).

But I dont know how to get the textboxes to populate with the PartID, Location, Date and Quantity that link the Product I select from the drop down and also to edit them assuming an error was enter to the data and then send back the correct information back to the table.

For example, if I select "Shoe" on the combobox (cboProd), I need the textboxes (txtPar, txtLoc, txtDat, and txtQty) to be populated with the values 12360, Store1, 25-Feb-10, and 100 respectively.

I also want to be able to edit and transfer those info to that same row.

I have shown the table below showing my data;

Product PartID Location Date Qty
Door 12345 Store4 23-Feb-10 15
Eject knob 12365 Store1 24-Feb-10 50
Shoe 12360 Store2 25-Feb-10 100
Screw caps 12380 Store3 26-Feb-10 50

(Sorry the table may not appear clearly, the top row is a row header)

Any Ideas? Please help.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Wow Thanks! No am not.
Was looking through the site you posted, I'll have a good look

Thanks again
 
Upvote 0
One more question please,

Is there a way to use a command button on a different worksheet or workbook to open the Data Form for a different worksheet that contains data, while that worksheet with data is hidden?

I tried using this code with a command button but it didn't work


Sub openForm()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("ProductInformation")

DataForm.Show

End Sub


Any Ideas?
 
Upvote 0
<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> openForm()<br>    Sheets("ProductInformation").ShowDataForm<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0
Wow!

Obviously I know very little about vba, trying to complicate matters with my code. Yours is simpler and It Works! Haha, Thanks A Million

:cool:
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

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