Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change label name with loop
Suppose I have a userform with 10 labels on it named
Label1, Lable2, Label3 ... Label10. These labels have different captions depending on user chosen uses. The captions can be defined by different arrays such as vArray1=Array("Apples", "Oranges" ,"Lemons"...) vArray2=Array("Red","Yellow","Blue",...) Is it possible to change the captions using a For statement like Sub LabelCaptions Dim oLabel as control, i as integer With UserForm1 For i = 1 To 10 Set oLabel =( "Label" & i ) oLabel.Caption = vArray1(i) Next End With End Sub When I try this I get an Error at the Set Statment How can I set oLabel to the variable name Thanks Merlyn |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change all label controltiptexts in userform | Excel Programming | |||
how to change width of label box in pie chart | Charts and Charting in Excel | |||
change label font | Excel Programming | |||
change label on multipage | Excel Programming | |||
On Error GoTo Label in a loop only working once. | Charts and Charting in Excel |