![]() |
Unhide row based on cell value
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. |
Unhide row based on cell value
Hi
Assuming your Yes/No is a form button, then in the attached macro you would put Range("B1").EntireRow.Visible = True regards Paul chris wrote: 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. |
Unhide row based on cell value
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 |
Unhide row based on cell value
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. " wrote: Hi Assuming your Yes/No is a form button, then in the attached macro you would put Range("B1").EntireRow.Visible = True regards Paul chris wrote: 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. |
Unhide row based on cell value
Then Bobbo's sub is the way to go
Paul chris wrote: 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. " wrote: Hi Assuming your Yes/No is a form button, then in the attached macro you would put Range("B1").EntireRow.Visible = True regards Paul chris wrote: 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. |
All times are GMT +1. The time now is 05:01 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com