ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiple Drop Down Boxes to Hide/Unhide Row (https://www.excelbanter.com/excel-programming/377475-multiple-drop-down-boxes-hide-unhide-row.html)

DtTall

Multiple Drop Down Boxes to Hide/Unhide Row
 
I have looked all over this group to find something that will help me
out, but no dice after several hours.

Here is my issue: I have 7 individual drop down boxes, each with a
Yes/No option. For box one, upon selecting "Yes" I want to make line
12 Unhide. If "no" was then selected it would re-hide the row. The
next box is similar except it is for row 21 and so on.

It seems simple, but I can't figure it out and any responses I found
either wouldn't work (using customized views because of so many
different options) or I couldn't get them to work (maybe I didn't
understand how to implement the code.

I am open to any solution, but I don't do much work in this area so
please explain.

Thanks,
DtTall


Bob Phillips

Multiple Drop Down Boxes to Hide/Unhide Row
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE_DV1 As String = "H1" '<== change to suit
Const WS_RANGE_DV2 As String = "J1" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

With Target
Select Case .Address(False, False)
Case WS_RANGE_DV1: Me.Rows(12).Hidden = .Value = "Yes"
Case WS_RANGE_DV2: Me.Rows(21).Hidden = .Value = "Yes"
'etc
End Select
End With

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



--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"DtTall" wrote in message
ups.com...
I have looked all over this group to find something that will help me
out, but no dice after several hours.

Here is my issue: I have 7 individual drop down boxes, each with a
Yes/No option. For box one, upon selecting "Yes" I want to make line
12 Unhide. If "no" was then selected it would re-hide the row. The
next box is similar except it is for row 21 and so on.

It seems simple, but I can't figure it out and any responses I found
either wouldn't work (using customized views because of so many
different options) or I couldn't get them to work (maybe I didn't
understand how to implement the code.

I am open to any solution, but I don't do much work in this area so
please explain.

Thanks,
DtTall





All times are GMT +1. The time now is 08:39 AM.

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