Trouble with UserForm

MDorsey

New Member
Joined
Feb 23, 2011
Messages
1
I have programmed quite extensively in VB.net but VBA is new to me. I am trying to access the Textboxes (about 80 of them) from the main Userform inside a procedure. I am using VBA 7.0 and I was trying to pass the form as an argument. Well, needless to say, I couldn't get it to work. Am I on the right track or do I need to do something else, like pass the collection of controls, or some other way? I really don't want to pass each individual textbox to proocedure. Any help would be appreciated.
Thanks.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Greetings, & Welcome.

Something like this may assist
(Passing the Control Array):

Usage within Form_Event:
Code:
Foo Me.Controls
Code:
'In a Module
Sub Foo(arrControls As MSForms.Controls)
For Each Control In arrControls
    With Control
        Debug.Print .Name
    End With
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top