Unhide row based on cell value

G

Guest

Hi

Is it possible to unhide a row based on the value of a cell?

I am creating a questionnaire and would like to unhide a question if a
certain answer is given. For example:

Cell A1 - 'Question: Do you have a criminal record? Yes/No'

If answer is Yes then a further question appears in B1 - 'Please provide
details'. If answer was no then this will not appear.
 
P

paul.robinson

Hi
Assuming your Yes/No is a form button, then in the attached macro you
would put

Range("B1").EntireRow.Visible = True

regards
 
B

bobbo

You can program this in your thisWorkbook module as an event handler
procedure

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)

If ActiveSheet.Range("a1").Value = "Yes" Then
ActiveSheet.Range("a2").EntireRow.Hidden = False
End If

End Sub
 
G

Guest

Paul - I was just planning on using a drop down arrow.

i.e. if the question was in row 1 and 'No' was answered a question would
then appear.
 

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

Top