Importing data from table row into userform

Skitto

New Member
Joined
Jun 12, 2015
Messages
5
I made a userform that is connected to a table. It works by inserting the desired input and then it takes the first empty row and inserts the data into the desired columns. It has a couple of questions which you answer. Basic questionnaire really.

The code that I use to enter the users input into the table looks like this : Copy userform data to table VBA - Pastebin.com

Now I want to make another userform that allows for the user to edit the already inserted data that is stored in the table. The userform that I made looks identical only to the first one, only difference is that it has a combobox at the top of the userform. The combobox rowsource is the A column, so basically the answer to the first question in the userform. When the user has chosen an alternative from the combobox I want to import the rest of the data that is on the same row as the selected item. Here is where I'm having trouble since I'm a beginner at VBA and excel.

How do write a code that knows what row to import based on the choice in the combobox?

I have written code that inserts the data into the Textboxes in the userform that looks like this : Edit table with userform VBA - Pastebin.com

So yeah, having trouble with importing the data into the userform because I don't know how to locate what row the data is coming from.

Also an additional side question to this: Once the user has edited the info, and want to save. I want to just save over the old one, so on the same row. I know that this is done the same way as the original input method, but here I also need to know the rowsource of the data, can the rowsource be non private in the VBA editor?


Any pointers would be greatly appreciated. And I thank you if you took the time to read this.

Skitto
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

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