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?
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Watch MrExcel Video

Forum statistics

Threads
1,122,841
Messages
5,598,388
Members
414,234
Latest member
grlevesq

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