Filling a User Form with data from a sheet

TonyBF

New Member
Joined
Jan 16, 2012
Messages
1
I have a user form which places data into rows on a spreadsheet. Once the data is in there I would like to have another user form which can be used to change that data and replace the old data.

The original form consists of text boxes, combo boxes, check boxes and option buttons as well as calculated fields.

The new form needs to be able to:

1 - select the row containing the data to modify;
2 - place that data into the form in the right boxes to allow changes to be made; and
3 - on completion of the changes place the updated data back in the row it came from.

I think I have point two under control (initilise the form using the data selected) but the data selection part and making sure it goes back onto the right row is something I can't get my head around. I was going to copy the original user form and the associated code and then just modify the bits of the code and controls that would no longer apply.

Any thoughts on how I can do points one and three or places to look for ideas?
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
How will you initially select the row with data to modify? i.e., if you know where the data is coming from, then you know where it need to go to as well.

so when your userform initializes, you will have to have some logic that says:

Code:
Userform1.TextBox1.Value = (Some Range Here)

Then with the submit button:

Code:
(Some Range Here).value = Userform1.TextBox1.Value

I have a user form which places data into rows on a spreadsheet. Once the data is in there I would like to have another user form which can be used to change that data and replace the old data.

The original form consists of text boxes, combo boxes, check boxes and option buttons as well as calculated fields.

The new form needs to be able to:

1 - select the row containing the data to modify;
2 - place that data into the form in the right boxes to allow changes to be made; and
3 - on completion of the changes place the updated data back in the row it came from.

I think I have point two under control (initilise the form using the data selected) but the data selection part and making sure it goes back onto the right row is something I can't get my head around. I was going to copy the original user form and the associated code and then just modify the bits of the code and controls that would no longer apply.

Any thoughts on how I can do points one and three or places to look for ideas?
 
Upvote 0
Hi TonyBF,

if you are looking for a method to select a range from the Userform, simply add the RefEdit control to your userform.
This will enable the user to select a range.
From there you can use the value of the RefEdit control to set a range.
 
Upvote 0

Forum statistics

Threads
1,215,235
Messages
6,123,779
Members
449,123
Latest member
StorageQueen24

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