AmardeepD
02-18-2008, 08:14 AM
ok so i have got a series of objects named Lblnumel1 through to Lblnumel15 and I want to be able to cycle through these changing their caption properties using a loop.
So far I have
For num = 1 To 15 Step 1
Labelname = "Lblnumel" & num
fstcellnum = 20 + num
seccellname = 21 + num
labelname.caption= num & ".) " & Worksheets("Sheet1").Range("B" & fstcellnum).value & Nextline & (Worksheets("Sheet1").Range("B" & seccellnum).value 'what i want it to equal
Next num
It says it has a problem with labelname.caption (which i am not surprised by) but i was also wondering if Nextline was the correct code to move down a line in the label :S:help
So far I have
For num = 1 To 15 Step 1
Labelname = "Lblnumel" & num
fstcellnum = 20 + num
seccellname = 21 + num
labelname.caption= num & ".) " & Worksheets("Sheet1").Range("B" & fstcellnum).value & Nextline & (Worksheets("Sheet1").Range("B" & seccellnum).value 'what i want it to equal
Next num
It says it has a problem with labelname.caption (which i am not surprised by) but i was also wondering if Nextline was the correct code to move down a line in the label :S:help