Hi Guys
I was wondering if it was possible to get a variable to change the reference to a the next label on a form. I would like to be able to select the next label without hard coding it if possible.
Example: Label1 then Label2 etc from "Label" & MyLabelNumber
I have had a go but to no avail.
On A user form I have 3 Labels.
In an Active cell I have: abc,def,ghi
Private Sub UserForm_Initialize()
Dim Arr1, Arr2
Dim i As Long
Dim MyLabelNumber As Long
Myname = ActiveCell.Value
Arr1 = Split(Myname, ",")
'MyLabelNumber = 1
'mytest = "Label" & MyLabelNumber
For i = LBound(Arr1) To UBound(Arr1)
Label1.Caption = Arr1(i)
'mytest.Caption = Arr1(i)
'MyLabelNumber = MyLabelNumber + 1
Next i
End Sub
Regards
Brad
I was wondering if it was possible to get a variable to change the reference to a the next label on a form. I would like to be able to select the next label without hard coding it if possible.
Example: Label1 then Label2 etc from "Label" & MyLabelNumber
I have had a go but to no avail.
On A user form I have 3 Labels.
In an Active cell I have: abc,def,ghi
Private Sub UserForm_Initialize()
Dim Arr1, Arr2
Dim i As Long
Dim MyLabelNumber As Long
Myname = ActiveCell.Value
Arr1 = Split(Myname, ",")
'MyLabelNumber = 1
'mytest = "Label" & MyLabelNumber
For i = LBound(Arr1) To UBound(Arr1)
Label1.Caption = Arr1(i)
'mytest.Caption = Arr1(i)
'MyLabelNumber = MyLabelNumber + 1
Next i
End Sub
Regards
Brad