R
RB Smissaert
When I add controls to an array in a For Each loop can I be sure that the
order of these controls in the array is
always the same?
They will be added like for example this:
Sub AddTextBoxesToArray(oForm As UserForm, lStart)
Dim ctl As MSForms.Control
Dim i As Long
i = lStart
For Each ctl In oForm.Controls
If TypeName(ctl) = "TextBox" Then
Set TextBoxes(i).objTextBox = ctl
i = i + 1
End If
Next
End Sub
I can be sure the start element is always the same as this is a Public
constant, but how about the rest?
RBS
order of these controls in the array is
always the same?
They will be added like for example this:
Sub AddTextBoxesToArray(oForm As UserForm, lStart)
Dim ctl As MSForms.Control
Dim i As Long
i = lStart
For Each ctl In oForm.Controls
If TypeName(ctl) = "TextBox" Then
Set TextBoxes(i).objTextBox = ctl
i = i + 1
End If
Next
End Sub
I can be sure the start element is always the same as this is a Public
constant, but how about the rest?
RBS