I'm trying to create a form or dependent list or ??? that will ask the user to answer a series of questions one at a time. The subsequent question wil

mjtaxpro

New Member
Joined
May 22, 2013
Messages
7
I'm trying to create a form or dependent list or ??? that will ask the user to answer a series of yes/no questions displayed one at a time. The subsequent questions will be determined by the previous answer. There will be approximately 15-20 questions, however a lot of the questions will be skipped based on the users answers. For example, if question 1 is answered no, the next question might be question 5 instead of question 2, etc. The end result needs to be the user being informed that yes they qualify based on the answers or no they don't qualify, and if they don't qualify, I'd like them to be informed of what answer disqualified them.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
You could probably do what you want with a series of message boxes using VBA.
Here is an example:
Code:
Sub Teststuff()
Resp = MsgBox("Do you like movies?", vbYesNo, "Question 1")
    If Resp = vbYes Then
        resp2 = MsgBox("Do you like Gory Sci=Fi movies?", vbYesNo, "Question 2")
            If resp2 = vbYes Then
                resp3 = MsgBox("Do you like all types of movies?", vbYesNo, "Question 3")
                    If resp3 = vbNo Then
                        Cells(Rows.Count, 6).End(xlUp)(2) = "Movies OK"
                    Else
                        Cells(Rows.Count, 6).End(xlUp)(2) = "Movies Suck"
                    End If
            End If
    End If
Resp = MsgBox("Do you like Candy?", vbYesNo, "Question 4")
    If Resp = vbYes Then
        resp2 = MsgBox("Do you like chocolate candy?", vbYesNo, "Question 5")
            If resp2 = vbNo Then
                Cells(Rows.Count, 6).End(xlUp)(2) = "Not a choc head"
            Else
                Cells(Rows.Count, 6).End(xlUp)(2) = "Is a choc head"
            End If
    End If
End Sub
But no matter what you use, you will need the If...Then statements or Select Case statements to control the responses and record the results. I suggested the Message Box approach because it already had the Yes/No buttons built in.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top