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
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