I am trying to hide/unhide rows when cell ("C9") changes. Cell "C9" changes based on selections from drop boxes in cells "C5", "C7" and "C8". It's been a while since I've used VBA in Excel so I was browsing online and came up with the following:
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Sub HideOverlay()
Application.ScreenUpdating = False
Application.EnableEvents = False
Range("'Quantities-Alt1'!A1:A" & Rows.Count).EntireRow.Hidden = False
If Range("'Quantities-Alt1'!C9").Value = "Asphalt Overlay" Then
Range("'Quantities-Alt1'!A16:A22").EntireRow.Hidden = True
Else
Range("'Quantities-Alt1'!A11:A15").EntireRow.Hidden = True
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
This works the first time cell "C9" changes but when it changes again (based on the selection in cell "C5", "C7" and "C8"), it does not hide/unhide the cells. I think I have to use Select Case or a loop or something but I haven't done this in a long time.
Any help is appreciated!
Thanks,
Nichole
Bookmarks