Hi,
I have two different data validations with dropdown lists on a worksheet. The first list in cell B20 is for a type of chair. The second list in cell H20 is for the backrest type of chair. If I select "Task" in cell B20 and I select "Mesh" in cell "H20" then I want rows 31:32 to be not be hidden and rows 33:34 to be hidden. If I don't select that specific combination then I want rows 31:32 to be hidden and rows 33:34 to not be hidden. The worksheet macro that I have is as follows (but obviously doesn't work):
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheets("X").Range("b20") = "Task" Then
If Sheets("X").Range("h20") = "Mesh" Then
Worksheets("X").Range("31:32").EntireRow.Hidden = False
Worksheets("X").Range("33:34").EntireRow.Hidden = True
Else: Worksheets("X").Range("31:32").EntireRow.Hidden = True
Worksheets("X").Range("33:34").EntireRow.Hidden = False
End If
End Sub
I have two different data validations with dropdown lists on a worksheet. The first list in cell B20 is for a type of chair. The second list in cell H20 is for the backrest type of chair. If I select "Task" in cell B20 and I select "Mesh" in cell "H20" then I want rows 31:32 to be not be hidden and rows 33:34 to be hidden. If I don't select that specific combination then I want rows 31:32 to be hidden and rows 33:34 to not be hidden. The worksheet macro that I have is as follows (but obviously doesn't work):
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheets("X").Range("b20") = "Task" Then
If Sheets("X").Range("h20") = "Mesh" Then
Worksheets("X").Range("31:32").EntireRow.Hidden = False
Worksheets("X").Range("33:34").EntireRow.Hidden = True
Else: Worksheets("X").Range("31:32").EntireRow.Hidden = True
Worksheets("X").Range("33:34").EntireRow.Hidden = False
End If
End Sub