ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel question (https://www.excelbanter.com/excel-programming/328758-excel-question.html)

[email protected]

Excel question
 
Hi all! I'm trying to accomplish the following through Excel, either
via programming or other:

I've created a questionnaire on one of the Sheets in Excel. There are a
total of 10 questions on the Sheet; for 3 of the 10 questions, a "Yes"
or "No" is the answer (delivered by a drop down list) - if the user
selects "Yes", I want Excel to unhide 4 rows beneath the question in
order to reveal 4 more sub-questions. If the answer is "No", the rows
remain hidden and the user goes on to the next question. Please help...

Thanks in advance...


Bob Phillips[_6_]

Excel question
 
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("H1:H100")) Is Nothing Then
With Target
If .Value = "Yes" Then
.Offset(1, 0).Resize(4, 1).EntireRow.Hidden = False
Else
.Offset(1, 0).Resize(4, 1).EntireRow.Hidden = True
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Hi all! I'm trying to accomplish the following through Excel, either
via programming or other:

I've created a questionnaire on one of the Sheets in Excel. There are a
total of 10 questions on the Sheet; for 3 of the 10 questions, a "Yes"
or "No" is the answer (delivered by a drop down list) - if the user
selects "Yes", I want Excel to unhide 4 rows beneath the question in
order to reveal 4 more sub-questions. If the answer is "No", the rows
remain hidden and the user goes on to the next question. Please help...

Thanks in advance...





All times are GMT +1. The time now is 02:28 PM.

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