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?
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?