Multiple Drop Down Boxes to Hide/Unhide Row

D

DtTall

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
 
B

Bob Phillips

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)
 

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