Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Labels and Captions
Hey all,
I realize this should be easy, but I'm not finding the solution. I have labels that are named Label1, Label2, Label3, ... I want a loop to set the label's caption such as For i = 1 to 5 Label(i).caption = "My Caption" Next i Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Labels and Captions
For i = 1 To 5
Controls("Label" & i) = "My Caption" Next iCt Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Labels and Captions
Assuming you have exactly 5 label controls and they all are named as LabelX,
Dim i As Integer For i = 1 To 5 Me.Controls("Label" & i).Caption = "My Caption" Next i If you wanted to just go through all label controls in the form, then something like this might give you an idea Dim c as control For each c in Me.Controls If TypeOf c is MSForms.Label then c.Caption = "My Caption" End If Next c " wrote: Hey all, I realize this should be easy, but I'm not finding the solution. I have labels that are named Label1, Label2, Label3, ... I want a loop to set the label's caption such as For i = 1 to 5 Label(i).caption = "My Caption" Next i Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
X axis captions | Charts and Charting in Excel | |||
Userform Captions | Excel Programming | |||
Clear Captions from labels | Excel Programming | |||
clear captions from all labels | Excel Programming | |||
reset menu captions | Excel Programming |