ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I automatically add or delete cells based on IF statements (https://www.excelbanter.com/excel-discussion-misc-queries/112051-can-i-automatically-add-delete-cells-based-if-statements.html)

Mike in OH

Can I automatically add or delete cells based on IF statements
 
Is it possible to set up a cell with a drop down menu selection of "Yes" and
"No" such that the selection of "yes" or "no" causes the spreadsheet to
display or hide additional cells with text. I am trying to set up a form
that contains questions that can be answered as yes or no. If the answer is
yes, I want to display a series of additional questions. Another way would
be to have an answer of "no" cause some of the cells with additional
questions to disappear. Can this be done?

Trevor Shuttleworth

Can I automatically add or delete cells based on IF statements
 
One way: set the colour of the font to the same as the background, for
example, white on white. Then use Conditional Formatting on all the cells.
If the value on the drop down box is "yes" then set the font colour to
automatic.

Conditional Formatting | Formulas is: =$A1="yes" Format | Font |
Colour: Automatic

Regards

Trevor


"Mike in OH" <Mike in wrote in message
...
Is it possible to set up a cell with a drop down menu selection of "Yes"
and
"No" such that the selection of "yes" or "no" causes the spreadsheet to
display or hide additional cells with text. I am trying to set up a form
that contains questions that can be answered as yes or no. If the answer
is
yes, I want to display a series of additional questions. Another way
would
be to have an answer of "no" cause some of the cells with additional
questions to disappear. Can this be done?




Dave Peterson

Can I automatically add or delete cells based on IF statements
 
Yep.

You could use data|Validation to allow only yes/no and a worksheet event that
would run when a cell changed.

Debra Dalgleish has some notes for data|validation:
http://www.contextures.com/xlDataVal01.html

Chip Pearson has notes about worksheet events:
http://www.cpearson.com/excel/events.htm

David McRitchie's notes:
http://www.mvps.org/dmcritchie/excel/event.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


Mike in OH wrote:

Is it possible to set up a cell with a drop down menu selection of "Yes" and
"No" such that the selection of "yes" or "no" causes the spreadsheet to
display or hide additional cells with text. I am trying to set up a form
that contains questions that can be answered as yes or no. If the answer is
yes, I want to display a series of additional questions. Another way would
be to have an answer of "no" cause some of the cells with additional
questions to disappear. Can this be done?


--

Dave Peterson

Pete_UK

Can I automatically add or delete cells based on IF statements
 
You could have something like:

=IF(A1="Yes","Another question ...","")

Hope this helps.

Pete

Mike in OH wrote:
Is it possible to set up a cell with a drop down menu selection of "Yes" and
"No" such that the selection of "yes" or "no" causes the spreadsheet to
display or hide additional cells with text. I am trying to set up a form
that contains questions that can be answered as yes or no. If the answer is
yes, I want to display a series of additional questions. Another way would
be to have an answer of "no" cause some of the cells with additional
questions to disappear. Can this be done?




All times are GMT +1. The time now is 11:58 PM.

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