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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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