Hi All,
I have a spreadsheet with 3 sheets, sheet1, sheet2 and sheet3. I've made a dropdown elsewhere with options 0, 1, 2, 3.
I want selecting each option to result in the following:
Select 0: Hide Sheet 1, 2, and 3
Select 1: Unhide Sheet 1, Hide Sheet 2 and 3
Select 2: Unhide Sheet 1 and 2, Hide sheet 3
Select 3: Unhide sheet 1, 2 and 3
On a similar vein, I'd ideally like the selection to also hide or unhide 3 adjacent rows, aka:
Select 0: Hide Row 1, 2, and 3
Select 1: Unhide Row 1, Hide Row 2 and 3
Select 2: Unhide Row 1 and 2, Hide Row3
Select 3: Unhide Row 1, 2 and 3
However, I sadly have no idea how to do this.
I've tried to do this but I cant seem to be able to get it to work.
Am I at all close?Private Sub Worksheet_Change(ByVal Target As Range)
If [NoModels] = "0" Then
Sheets(Array("Model1", "Model2", "Model3")).Visible = False
End If
If [NoModels] = "1" Then
Sheets("Model1").Visible = True
Sheets(Array("Model2", "Model3")).Visible = False
End If
If [NoModels] = "2" Then
Sheets(Array("Model1", "Model2")).Visible = True
Sheets("Model3")).Visible = False
End If
If [NoModels] = "3" Then
Sheets(Array("Model1", "Model2", "Model3")).Visible = True
End If
End Sub
If anyone could help me out, and let me know how to adapt this to include rows too, I would be unbelievably grateful.
Bookmarks