Hiding a textbox on a userform for later use

birdieman

Well-known Member
Joined
Jan 13, 2016
Messages
551
If I wanted to put a hidden textbox on a userform for potential use at a later time (maybe months),

1. would I add it now to the userform, and then in the properties box, make Visible = False? (is this all I need to do to hide it?

2. If I do this, can I put something (like a label or even another textbox) on top of the hidden one, or should I not cover it up to prevent future issues?

3. On the hidden textbox, should I also set tab stop=false and lock=True so user does not somehow put something in it (or will the tab and lock be automatic if the textbox is hidden?)

thanks for looking
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
1. Yes.
2. Don't, you'll just get overlapping boxes.
3. No need, controls that cannot get focus, such as disabled and invisible controls, don't have a TabIndex property and are not included in the tab order. As a user presses the TAB key, these controls are skipped.
 
Upvote 0
Agreed. The point of having it hidden now is that you can just pop it into visibility later with one command. If you have another something on top of it and need to move things around after you make it visible, you'd just be better off creating it when you need it because you'd need to do just as much work.

Another option is renaming the one that's there.... If you need to put one on top of the hidden one, that seems to indicate that it will be going away once the new one is visible... Just use the same one and change the name. Make sure you comment out all code references to it that will no longer apply/will result in an error.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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