Write data from multiple textboxes back to cell after a textbox is updated

Alex Hospers

New Member
Joined
Feb 13, 2016
Messages
8
I have made 16 textboxes on a userform.
It seems easy to fill those textboxes with cell values, done in a single line like this:
For x = 1 to 20
Controls("textbox" & x).value = cells(1, x).value
Next x

What it does is loop through the 16 textboxes and fills them with the cell values.
Great, doing exactly what i want it to do.

Now the other way around.
When EITHER of the 16 textboxes has a changing value, it needs to write the textbox values back to the cells x, for all 16 of them. Now i am wondering if i can prevent to write 16 textbox(x)_AfterUpdate events, but do this in 1 simple loop?
In other words, How to trigger a cells(1,x).value=Controls("textbox" & x).value action when one of the boxes changes?

Anyone a suggestion?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,650
Messages
5,854,948
Members
431,687
Latest member
anthonyj

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
Top