Lost user form controls in design mode

HallidayMJ

New Member
Joined
Nov 7, 2009
Messages
2
Im creating a reasonably sized user form with a number of frame controls with inset option buttons. However in edit mode it is easy to either a) lose an option button control within the frame, or b) manage to drag the frame and lose it as it seems to 'bump' into another frame.

Edit 'undo' will not retrieve the lost items. However they still 'exist'. For example I had a frame frmModel with 8 option butons for 8 different models, each named along the lines of optModel1 optModel2 etc.

So I manged to lose the frame and option buttons. No problem I'll recreate it. However I couldnt use the optModel1 (etc.) names again. The error message declered the names to be ambiguous. If I create a loop to run through all the controls on the user form they are there! But they are nowhere to be seen on the user form in design mode.

So my question is this:
Is there a way to find and delete the 'lost' items? I simply want to clean up the form especially form a programming perspective. I have to plan for and skip over the missing controls.

Many thanks for your help,
Mike
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You should be able to work with the option buttons in the VBA editor.
In design mode, with your userform visible, click on one of the option buttons. If you have the properties window open, (F4 will open it), you can see the name of the object in its title property. Hitting the Tab key will move to the next object. When you get to the one you want to delete, hit the Delete key.
 
Upvote 0
You should be able to find all the controls on the form in the dropdown at the top of the Properties Window.

Even thought you might not see them you can select them and press Delete to remove them.:)

Basically, what John said.:oops:
 
Upvote 0
Thank you for your time and advice. However, the objects are not available in the properties window. I tried tabbing through all objects - which I though was an excellent idea. But still no cigar.

I looked in the Names collection - but they aernet there.

Pleae dont worry too much - I can avoid the 'missing' objects in software.

Thanks for your kindness.

Mike
 
Upvote 0
Mike

If this is a userform then there is no way they would appear in the Names collection.

And I think you should bother about them - it is not a good idea to have to write code to avoid certain controls.

In fact it's a bad idea to have these hidden controls.

I think the reason they aren't listed in the dropdown is probably because you are using frames.

Personally I wouild dump the userform and start over.:)
 
Upvote 0
I had the same issue after going through a lot of effort to format a frame. I found my missing frame by adding a code that did this:

msgbox me.textbox1.parent.name 'name of your missing frame (at least for me)
msgbox me.textbox1.parent.parent.name '(name of the frame that it got lost in)
msgbox me.textbox1.parent.top
msgbox me.textbox1.parent.left


obviously replace the textbox1 with one of your lost controls.

the reason I did it twice is because I had a textbox in a frame1 and that somehow was moved into frame2

My Top and Left values values were negative numbers so there was no possiblity of seeing them in the GUI.

Once you figure out which frame your missing controls are in, select that one by clicking on it. From the properties drop down select your missing control/controls. Change the Top and Left properties to 0 so that you can actually see them in the GUI to move them back to where you want them to be.
 
Upvote 0
I had the same issue after going through a lot of effort to format a frame. I found my missing frame by adding a code that did this:

msgbox me.textbox1.parent.name 'name of your missing frame (at least for me)
msgbox me.textbox1.parent.parent.name '(name of the frame that it got lost in)
msgbox me.textbox1.parent.top
msgbox me.textbox1.parent.left

I found this a very good suggestion, so I took it a stage further and built a userform to access and present the control hierachy information for any control (selected from a listbox populated with the names of all the controls) on a userform identified by name. I can't find a way to upload userforms to MrExcel :(. I have written about this form on another list (see here), which includes a macro enabled word document that contains a copy of the form and the associated code.

Richard (from Piracicaba, SP, Brazil).
 
Upvote 0
OH my god. thank you SO much, i have been loosing my mind about not being able to find some of my controls... Thanks you! :)
 
Upvote 0
OH my god. thank you SO much, i have been loosing my mind about not being able to find some of my controls... Thanks you! :)

Lost Frames/buttons/CheckButtons Ect. Are some times swallowed by othere frames/or Hidden behind Object.

If you Click the edge of a frame, so the Properties Window displays the ["Frame Name" Frame] in its top window.
You can then use the pull down Tab to See all Objects in that frame.
You can then Enlarge the frame/reorder the Objects Front/Back to see the hidden Object.
and Drop/Drag the object to its correct place.
 
Upvote 0

Forum statistics

Threads
1,216,071
Messages
6,128,628
Members
449,460
Latest member
jgharbawi

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