I have some odd behavior occuring with my UserForm.
I had inserted a ListBox into the UserForm, and I was re-positioning the control when...I don't know what happened...my finger slipped off the mouse, or something. But, the ListBox simply VANISHED!!
No problem, right?? I simply grabbed and inserted another control.
The NEW control is listed in the UserForm Properties as ListBox2...!!!
ListBox1 is NOWHERE TO BE FOUND...!!!
It's not listed in the UserForm Properties...(ListBox2 is there).
It's not visible on the UserForm, itself...(ListBox2 is).
I even looked in the Tab Order for the UserForm...again, ListBox2, but no ListBox1.
And get this...If I try to RENAME ListBox2 to ListBox1, I get an "ambiguous name" error.
Here's why this is a problem...
I have lots of Macros or Event Procedures written to perform actions with the items found in ListBox1 on all of my UserForms. I will have to re-write all of that code to make it work with this UserForm...
Or, I can re-build the UserForm from scratch...which is probably what I will end up doing.
So...here's my questions:
Does anybody have any idea what happened, here??
Have you ever experienced this before??
And, if so...do you know how to fix it without scrapping the UserForm??
I spent a while searching for the solution on the internet...and couldn't even find anyone that had experienced a similar situation.
Any insight would be greatly appreciated.
Last edited by HuskerBronco; 06-27-2011 at 10:33 AM. Reason: solved
Can you attach the workbook?
If the worst comes to the worst you can quickly amend the codes by using Find & Replace ListBox1 for ListBox2
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
You could try running a quick macro to delete ListBox1:
If this runs without any errors then it will have deleted ListBox1 and you can try renaming ListBox2 again. If you get an error then the macro can't find a shape called ListBox1 either.Sub DelShape() ActiveSheet.Shapes("ListBox1").Delete End Sub
Alternatively, can you copy everything (except the controls) into a new workbook and add them again from scratch?
Last edited by Kafrin; 06-27-2011 at 08:59 AM.
Do you have any frame controls or multipages on the form?
Rename the control currently named ListBox2 to have the name ListBox1, using the Properties window.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
I was about ready to do just that, royUK...but then I got to thinking, "There's GOT to be a better way!!".
Most of the code is in my Personal.XLSB workbook, and it can't be changed or it won't work for other projects.
I even considered putting the amended code in a module JUST to handle this specific UserForm.
What I was hoping to find, was a way to delete this "invisible" control with a Macro...like Kafrin suggested:
This is what I was looking for...!!! With one small exception.Sub DelShape() ActiveSheet.Shapes("ListBox1").Delete End Sub
My "invisible" control is on a UserForm, not a worksheet.
How do I write code to delete a control from a UserForm, in the event that I ever need to??
I won't have to do that in this situation...not after reading this:
YES...!!! I DO have TWO frame controls on the UserForm...!!!
I thought about this myself, a few hours ago...and I THOUGHT that I had checked the Properties of the frame controls
for the AWOL control. Apparently, I didn't check BOTH frame controls...because I JUST found the dang control in the second Frame!!!
I pulled the lower border of the Frame control down...and there was my ListBox peeking up from underneath the frame...!!!
UNBELIEVABLE...!!! This explains how my control "disappeared" while I was dragging it to a new position.
I must have released it while I was INSIDE the frame.
Such a simple thing...and it robbed me of 3 hours of my life...!!!
Thanks for taking the time to answer my post, guys.
Last edited by HuskerBronco; 06-27-2011 at 10:38 AM. Reason: Fix typos
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks