Label Names Nightmare

g-man97

New Member
Joined
Sep 30, 2004
Messages
24
I have created a monster. I went nuts creating several userforms to display reports. I created a column of labels and then copied them into several userforms. To make things look pretty I moved them around, removed some, added some, etc.

What I ended up with is a HUGE number of labels (anywhere from 60 on a userform, all the way up to 300 on another)! On these userforms the labels are organized into groups and subgroups, e.g. one group for each office, with 2 subgroups under each office. Groups are in Frames, (but not the subgroups) if that matters! I need to redefine the CAPTION property of each of the labels -- no sweat, thanks to this board I can handle that with this code:

For NewLabels = 35 To 50
Me.Controls("Label" & NewLabels).Caption = _
Sheets("TmpTbl").Cells(R1, 81)
R1 = R1 + 1
Next

Here's the problem: To pass the label names in the above code, I need to have the LabelNames numbered CONSECUTIVELY, so I can assign the captions to the various groups of labels. As it is now Label46 might be in Group "A" and Label47 in Group "B". HELP!! Is there any way to do this?

Any suggestions, short of my solution of going to the tedious and painstaking effort of going into the properties window of each label and reassigning the LabelName to Label1, Label2, etc. would be MUCH appreciated. Even a cut and paste solution wouldn't be bad.

Thanks in advance for all the GREAT advice.


G-Man
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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