E
Evan
Hi,
I have a user form containing several text boxes (AA,BB,CC), etc. I want to
set variables (AAvar,BBvar,CCvar) to the values of those text boxes. I am
looking for a way to cycle through the textboxes and set the given variable
based on the control name. Such as:
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox Then
With ctrl
Set Cstr(.name) & "var" = ctrl.value
......
Obviously this method doesnt work but hopefully explains what I am
after...any technique to use the control name to refer to a similiarly named
variable
Thanks
I have a user form containing several text boxes (AA,BB,CC), etc. I want to
set variables (AAvar,BBvar,CCvar) to the values of those text boxes. I am
looking for a way to cycle through the textboxes and set the given variable
based on the control name. Such as:
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox Then
With ctrl
Set Cstr(.name) & "var" = ctrl.value
......
Obviously this method doesnt work but hopefully explains what I am
after...any technique to use the control name to refer to a similiarly named
variable
Thanks