Unloading an array to TextBoxes on a UserForm 
Author Message
 Unloading an array to TextBoxes on a UserForm

I have an array with entries I want to load to a "matrix"
of TextBoxes in a UserForm.  The UserForm also contains a
number of other controls - Labels, frames option buttons,
etc.

How do I select/address only the text boxes that are on
the UserForm> I tried "For Each c in Controls" but that
gets me the controls on the form, and I can't seem to
narrow the focus to just TextBoxes.

Thanks, in advance, for any help!



Mon, 25 Oct 2004 20:35:04 GMT  
 Unloading an array to TextBoxes on a UserForm
Try

If Typename(c)="TextBox" Then
....
End if

Alex.

Quote:
> I have an array with entries I want to load to a "matrix"
> of TextBoxes in a UserForm.  The UserForm also contains a
> number of other controls - Labels, frames option buttons,
> etc.

> How do I select/address only the text boxes that are on
> the UserForm> I tried "For Each c in Controls" but that
> gets me the controls on the form, and I can't seem to
> narrow the focus to just TextBoxes.

> Thanks, in advance, for any help!



Tue, 26 Oct 2004 01:42:42 GMT  
 Unloading an array to TextBoxes on a UserForm
Hi Dan,

Quote:
> How do I select/address only the text boxes that are on
> the UserForm> I tried "For Each c in Controls" but that
> gets me the controls on the form, and I can't seem to
> narrow the focus to just TextBoxes.

------------------------------------------------------------
Dim oControl As Control

For Each oControl In Me.Controls
    If TypeOf oControl Is MSForms.TextBox Then
        MsgBox oControl.Name
    End If
Next oControl
------------------------------------------------------------

Hope this helps.
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Tue, 26 Oct 2004 22:11:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Userform: populate textbox with date from another textbox

2. UserForms, Load and Unload

3. Printer won't print unless I unload userform

4. Loading/Unloading Userform

5. Userform Hide vs. Unload Me

6. Basic (!) userform query - greying out of textboxes

7. datetimeformat in userform.textbox

8. UserForms, Textboxes & Bookmarks

9. Userforms - populating textboxes

10. Invoking autocorrect from textbox on a userform

11. Greying out textboxes in a userform

12. Focus and textboxes on vba userforms

 

 
Powered by phpBB® Forum Software