Hi,
I am trying to find an efficient way to list a set of non-contiguous rows to be hidden based on the value of a cell and the color of the rows being hidden. Right now I have this code that works but I would like the hiding to be based on the color of cell A in each potentially hidden row instead of having to list each row that needs to be hidden.
These are the list of colors:
#FABF8F - hidden for "Level 1"
#E26B0A - hidden for "Level 1" or "Level 2"
We would still like to hide rows 24:459 if "<Select>" is the value.
BTW - the list of rows will be much longer that what is being shown in the examples above.
Thanks in advance for your help!
I am trying to find an efficient way to list a set of non-contiguous rows to be hidden based on the value of a cell and the color of the rows being hidden. Right now I have this code that works but I would like the hiding to be based on the color of cell A in each potentially hidden row instead of having to list each row that needs to be hidden.
VBA Code:
If Target.Address(False, False) = "C16" Then
Application.ScreenUpdating = False
Rows("24:490").Hidden = False
Select Case Target.Value
Case "Level 1"
Rows("28").Hidden = True
Rows("100:189").Hidden = True
Case "Level 2"
Rows("24:85").Hidden = True
Case "Level 3"
Rows("24:336").Hidden = False
Case "<Select>"
Rows("24:459").Hidden = True
End Select
Application.ScreenUpdating = True
End If
End Sub
These are the list of colors:
#FABF8F - hidden for "Level 1"
#E26B0A - hidden for "Level 1" or "Level 2"
We would still like to hide rows 24:459 if "<Select>" is the value.
BTW - the list of rows will be much longer that what is being shown in the examples above.
Thanks in advance for your help!