ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding Rows after dropdown menu (https://www.excelbanter.com/excel-programming/431813-adding-rows-after-dropdown-menu.html)

newconcenemp

Adding Rows after dropdown menu
 
I am trying to add some subquestions after a Yes or No question. For example:

Does an IT system exist? (yes/no)
If yes, have we discussed a system? (yes/no)
Details

I have the question "Does an IT system exist" with a dropdown yes/no box and
if yes is chosen I want a row containing "If yes, have we discussed a
system?" and another yes/no drop down box to appear and then if yes is chosen
again, one last row with "Details" to appear.

This is just one example of what I need but I think if someone could show me
more or less the basics of how to insert a row with text after an answer is
chosen I could figure the rest out on my own (hopefully!)

Thank you for your help!

ryguy7272

Adding Rows after dropdown menu
 
If I were you, I'd use something like this:

YesNo = MsgBox("Has such and such happened?", vbYesNo, "Warning")
Select Case YesNo
Case vbNo
'If answer is Yes, no additional action needs to be taken...
Unload UserForm2
UserForm3.Show
Case vbYes '#1
'Insert your code here if No is clicked
YesNo = MsgBox("Does such and such happen?", vbYesNo, "Warning")
Select Case YesNo
Case vbYes
MsgBox "The User clicked YES!!"

Case vbNo '#2
YesNo = MsgBox("You answered no. Are you sure?", vbYesNo,
"Warning")
Select Case YesNo

Case vbYes
UserForm4.Show
Unload UserForm3

Case vbNo '#3
MsgBox "You answered no. Please start again!!"
Exit Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"newconcenemp" wrote:

I am trying to add some subquestions after a Yes or No question. For example:

Does an IT system exist? (yes/no)
If yes, have we discussed a system? (yes/no)
Details

I have the question "Does an IT system exist" with a dropdown yes/no box and
if yes is chosen I want a row containing "If yes, have we discussed a
system?" and another yes/no drop down box to appear and then if yes is chosen
again, one last row with "Details" to appear.

This is just one example of what I need but I think if someone could show me
more or less the basics of how to insert a row with text after an answer is
chosen I could figure the rest out on my own (hopefully!)

Thank you for your help!



All times are GMT +1. The time now is 06:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com