Hide/Unhide Rows Based Upon Drop-Down Option Selected

kkm_

New Member
Joined
Jan 15, 2010
Messages
1
I know there is probably a simple way to do this, but I'm new to VBA. I have multiple drop-down lists and for some I am trying to unhide rows if a specific drop-down item is selected and rehide them if the drop-down item is later changed. For example, if in row 17 "Red" is selected, rows 18 and 19 will unhide but if "Green" is selected, rows 18 and 19 remain hidden or re-hide if "Red" was previously selected.

If you have any suggestions, please let me know! Thanks!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi and welcome to the board!!!
Your question is somewhat vague, but this should get you started
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$17" Then Exit Sub
Rows(18).EntireRow.Hidden = False
Select Case Target
Case "Red"
Rows(18).EntireRow.Hidden = True
Case "Green":
Case Else:
End Select
End Sub
In the worksheet module. RightClick the sheet tab and choose "View Code'
lenze
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,539
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top