Basically I have a userform with textboxes for input from the user. If the user needs more rows of boxes, they can generate them based on how many they need. I want the generated rows to share the same events as the default ones. For example:
For X = 1 To n
Set TextBoox1 = MultiPage1.Pages(2).Controls.Add("Forms.TextBox.1", "extrabox" & (X), 1)
With TextBoox1
.Width = textbox5.Width
.Height = textbox5.Height
.Top = textbox5.Top + (X * (textbox5.Top - textbox4.Top))
.Left = textbox5.Left
.Visible = False
End With
Next X
This is part of a bigger script which loops through X to generate the proper number of rows in the userform. It adds these to the specified page in a multipage, and sets it to an equal height as the default textboxes (there are 5), with an appropriate placement on the screen. Now I want to give it the following properties without needing to know ahead of time how many rows the user will create:
Private Sub extrabox1_Change()
extrabox1.Value = UCase(extrabox1.Value)
End Sub
I am wondering if these events can be set dynamically at runtime somehow. Even if I have to set all textboxes in the entire userform to be uppercase, that would be fine too.