Unhide/hide based on drop down list

S

SoilSaver

I have a cell with a drop down list (using data validation, list) and it has
3 values in it: High, Medium and Low. If the user chooses "Low", the
following 3 rows remain hidden. If the user chooses "Medium" or High", the
following 3 rows need to unhide so they can explain their reasoning. I am
new to macros, but found this macro that worked if I had only 2 choices on
the list:

Sub HideRows()
Dim Rng As Range
Set Rng = Sheets("Sheet1").Range("A3")
If Rng.Value = "High" Then
Rows("4:6").EntireRow.Hidden = False
Range("A9").Select
ElseIf Rng.Value = "Low" Then
Rows("4:6").EntireRow.Hidden = True
Range("A9").Select
End If
End Sub

What I want is a macro that will work with 3 choices (actually 4 - also hide
if blank), and is live, so that if the user chooses low at first, but then
comes back later and chooses high, the rows will unhide then.
 

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