LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Order of controls in For Each Loop

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
accesing controls in for each loop Gixxer_J_97[_2_] Excel Programming 1 May 25th 05 05:30 AM
How to loop through controls on a MultiPage 42N83W Excel Programming 11 February 14th 05 11:32 PM
Loop through objects/controls on worksheet Tom V Excel Programming 2 September 16th 04 06:09 PM
loop through controls libby Excel Programming 0 August 14th 04 12:41 PM
What order does VBA look at userform controls? Brad Patterson Excel Programming 3 July 17th 03 03:46 AM


All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"