jparfitt87
New Member
- Joined
- Jul 13, 2012
- Messages
- 23
hi all,
I'm currently creating a survey in excel and want it to be more user managable without the user having to go into VBA coding.
i have a page called "questions" within here is where the questions are and what type of answer is needed.
this is then picked up through vba code to plave it into the userform, see below:
LabelQ1AV.Caption = Range(FrmScope.LabelQ1AV.Name)
'This shows what the question is on the questions page......
If LabelQ1AV.Caption = "" Then
LabelQ1AV.Visible = False
Q1.Visible = False
CmbQ1.Visible = False
End If
'This hides the title, question and answer box if theres no question on the Q Sheet
If Worksheets("Questions").Range("ResponceQ1AV") = "Answer_Set_1" Then
FrmScope.CmbQ1.List = Worksheets("Answers").Range("Answer_Set_1").Value
Else
If Worksheets("Questions").Range("ResponceQ1AV") = "Answer_Set_2" Then
FrmScope.CmbQ1.List = Worksheets("Answers").Range("Answer_Set_2").Value
Else
If Worksheets("Questions").Range("ResponceQ1AV") = "Answer_Set_3" Then
FrmScope.CmbQ1.List = Worksheets("Answers").Range("Answer_Set_3").Value
End If
End If
End If
'This picks up the answers that are needed on the answers page, eg very happy, excellent, etc...
now this above code works perfectly for 1 question........ but i have at least 40 of them!! and dont want to have to repeat this code 40 times!
I need to know if there is a way to loop through the questions page and the user form???
I hope that makes sense.
Thanks in advance
I'm currently creating a survey in excel and want it to be more user managable without the user having to go into VBA coding.
i have a page called "questions" within here is where the questions are and what type of answer is needed.
this is then picked up through vba code to plave it into the userform, see below:
LabelQ1AV.Caption = Range(FrmScope.LabelQ1AV.Name)
'This shows what the question is on the questions page......
If LabelQ1AV.Caption = "" Then
LabelQ1AV.Visible = False
Q1.Visible = False
CmbQ1.Visible = False
End If
'This hides the title, question and answer box if theres no question on the Q Sheet
If Worksheets("Questions").Range("ResponceQ1AV") = "Answer_Set_1" Then
FrmScope.CmbQ1.List = Worksheets("Answers").Range("Answer_Set_1").Value
Else
If Worksheets("Questions").Range("ResponceQ1AV") = "Answer_Set_2" Then
FrmScope.CmbQ1.List = Worksheets("Answers").Range("Answer_Set_2").Value
Else
If Worksheets("Questions").Range("ResponceQ1AV") = "Answer_Set_3" Then
FrmScope.CmbQ1.List = Worksheets("Answers").Range("Answer_Set_3").Value
End If
End If
End If
'This picks up the answers that are needed on the answers page, eg very happy, excellent, etc...
now this above code works perfectly for 1 question........ but i have at least 40 of them!! and dont want to have to repeat this code 40 times!
I need to know if there is a way to loop through the questions page and the user form???
I hope that makes sense.
Thanks in advance