Controls

Digitborn.com

Active Member
Joined
Apr 3, 2007
Messages
353
Hello,

If you have UserForm1 & UserForm2 on one excel file. On UserForm1 you have TextBox1 and on UserForm2 you have ComboBox2. Is it possible to visualize like this:
Code:
Private Sub UserForm1_Initialize()
    UserForm2.TextBox1.Visible = True
End Sub

Private Sub UserForm2_Initialize()
    UserForm1.TextBox1.Visible = True
End Sub
I just wonder why the VBA Editor allows (find) me the control when I'm writing it on the other UserForm... and it's not visualize outside controls (though the same file)!?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I assume that you mean

Code:
Private Sub UserForm_Initialize()
    UserForm2.TextBox1.Visible = True
End Sub

Private Sub UserForm_Initialize()
    UserForm1.TextBox1.Visible = True
End Sub

etc., but what exactly is the question? Are you asking why can you access controls from a different form? If so, they are exposed, so you can do it from a form, a worksheet, or a code module.
 
Upvote 0
Yes, this is one of the 2 questions - Can I access controls from different form and what the point if I cannot visualize them on the form I'd like to access?

The other question is - Is there any chance to visualize a control from another form?

p.s. I just put UserForm1_Initialize() & UserForm2_Initialize() because I wanted to be more clear what i mean.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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