Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel label question

Status
Not open for further replies.

Leslie67

Programmer
Jul 23, 2002
42
US
I have a user form where I have a bunch of labels working as "tool tips".

I created one label and named it, tested it to make sure that it appeared and disappeared when I needed it to, and then created 9 more labels using the same template.

Unfortunately, now I have two labels that, although they're named differently, show as "label1" in the "name box".

How can I change one of the "label1"s to "Label10"?
 
Hi,
Normally you can not add controls into the same form with the same name more than once. For example you can not add two or more labels in your form with the same name say "label1".
But you can define a control array so there may be many labels with the same name but different INDEX property.

On the other hand, defining control arrays requires writing code. I mean you must define the control manually. If you duplicated your label by copying and pasting, the names are different but the captions are the same.

But if you didn't define your label controls by hand as an array (meaning by code) there is a problem. In this case I recommend you backing up all the function and variable definings and the other codes... and removing that form and recreating it. Because sometimes programs can act in a strange manner..

I hope this helps.
 
actually, that's exactly what I ended up doing.

I deleted all the labels and redid them.

The hardest part being that I had to name the labels the same as I had before because I'd already written the code and was NOT going to rewrite that!

Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top