Hide and unhide row when asking a question

  • Thread starter Thread starter Prossygk
  • Start date Start date
P

Prossygk

I need a formula when the worksheet come up just three question shows. but
when the last question is asked and it is a true statement I would like
excell to show the rest of the rows but if the question is no then excell
keeps the rows hidden. For example

If Question 1 is Yes(True)- Keep rows 16 through 84 hidden
IF Question 2 is Yes(True) keep rows 16 through 84 hidden
If Question 3 is Yes(True) Undie rows 16 through 84.

Am I wishing on a pipe dream?
 
This is possible using macros, the following code can be placed on the Sheet
that the questions on in the VBA code:


Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D1").Text = "Yes" And Range("D2").Text = "Yes" And _
Range("D3").Text = "Yes" Then Rows("16:84").EntireRow.Hidden = False
Else _
Rows("16:84").EntireRow.Hidden = True
End Sub



You might want to place the code:

Rows("16:84").EntireRow.Hidden = True

in the workbook open statement to make sure that those rows are hidden when
the workbook opens.
As far as using a formula, I am not aware of a formula that can hide or
unhide rows or columns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top