
January 16th, 2006, 05:58 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 1
Time spent in forums: 14 m 2 sec
Reputation Power: 0
|
|
Variable Label name
Basically my problem is I have a spreadsheet with a load of questions in it, and I have a form with lots of captions. When the form loads I want the captions of the labels to correspond with the questions.
Because im lazy im trying to do it the easy way by having them all numbered so I can just increment the number by 1 to represent a new label caption
Code:
Private Sub UserForm_Initialize()
Dim intValue
Dim Question
Dim strQuestion
For intValue = 1 To 27
Question = "Question" & intValue & ".Caption"
MsgBox Question
strQuestion = Cells(intValue + 3, "S").Value
MsgBox strQuestion
Question = strQuestion
MsgBox Question
Next
End Sub
Thats what I have so far but it doesnt like the way im representing the label.caption
Any help would be greatly appreciated!
N.B. I stuck in a couple of msgBox's to test the outcomes of things
Frank 
|