I have a spreadsheet that has drop down lists that hides/unhides rows of cells based on the selection. The first set of lists are at the top and the second set are at the bottom. I noticed when I change other cells in the middle, it unhides the rows that were hidden based on the list selection at the top. Is there are reason it is doing this? I want to be able to change the selection at any point in the spreadsheets and be able to delete/add values in cells that have nothing to do with the change event below.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("A1:A" & Rows.Count).EntireRow.Hidden = False
If Target = Range("C5") Or Target = Range("C7") Or Target = Range("C8") Then
If Range("C9").Value = "Select ADT and ADTT (above)" Then
Range("A11:A15").EntireRow.Hidden = False
Range("A16:A22").EntireRow.Hidden = False
ElseIf Range("C9").Value = "Asphalt Overlay" Then
Range("A16:A22").EntireRow.Hidden = True
Else
Range("A11:A15").EntireRow.Hidden = True
End If
End If
If Target = Range("C83") Or Target = Range("C89") Or Target = Range("C95") Then
If Range("C83").Value = "No" Or Range("C83").Value = "(select)" Then
Range("A84:A87").EntireRow.Hidden = True
Else
Range("A84:A87").EntireRow.Hidden = False
End If
If Range("C89").Value = "No" Or Range("C89").Value = "(select)" Then
Range("A90:A93").EntireRow.Hidden = True
Else
Range("A90:A93").EntireRow.Hidden = False
End If
If Range("C95").Value = "No" Or Range("C95").Value = "(select)" Then
Range("A96:A99").EntireRow.Hidden = True
Else
Range("A96:A99").EntireRow.Hidden = False
End If
End If
If Target = Range("C107") Or Target = Range("C113") Or Target = Range("C119") Then
If Range("C107").Value = "No" Or Range("C107").Value = "(select)" Then
Range("A108:A111").EntireRow.Hidden = True
Else
Range("A108:A111").EntireRow.Hidden = False
End If
If Range("C113").Value = "No" Or Range("C113").Value = "(select)" Then
Range("A114:A117").EntireRow.Hidden = True
Else
Range("A114:A117").EntireRow.Hidden = False
End If
If Range("C119").Value = "No" Or Range("C119").Value = "(select)" Then
Range("A120:A123").EntireRow.Hidden = True
Else
Range("A120:A123").EntireRow.Hidden = False
End If
End If
Application.EnableEvents = True
End Sub
Thanks,
Nichole
Bookmarks