Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a UserForm on which I've placed a great many TextBoxes
named TextBox01 through TextBox50, with Tabindex 0 through 49, respectively. I now want to write their contents to a file and have written the following real simple code after opening a sequential file: Dim ctl as Control For Each ctl in UserForm.Controls if Typename(ctl) = "TextBox" then Print #1, ctl.Text Next Close #1 What happens, however, is that the resultant file contains the contents of TextBoxes in a seemingly random order, which has no relationship to the alphanumeric ordering of the TextBox names or their respective Tabindexes. When I pull up the list of controls using Project Explorer, they all appear in proper alphanumeric order. My immediate work-around has been to modify the above procedure to extract the right two characters of the control name and use these as a subscript for a one- dimensional array to temporarily store the data, and then to print the temporary file in sequential order. My question is, is there a way to force Excel to inherently reference the TextBoxes so that I do not have to resort to messy code and have the simple version above do the job? -- Dennis Eisen |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform question | Excel Discussion (Misc queries) | |||
An Interesting vba Excel quirk | Excel Discussion (Misc queries) | |||
an interesting Excel question | Excel Discussion (Misc queries) | |||
Interesting Counting Question...HELP | Excel Discussion (Misc queries) | |||
interesting question can anyone help | Excel Discussion (Misc queries) |