C
CH
I have the following code below in which I want it to check the value
of two cells and if the two cells = certain values then hide rows on a
different sheet.
For example if A12 = "BLUE" AND B16 = "DOG" then hide rows on sheet
"CAR" Else dont hide the rows.
I prefer to use the case select statement but the code below doesn't
work. Why?
'Case Select
'=====================================
Select Case testcase
Case UCase(Range("A12").Value = "Blue", Range("D27") = "Dog")
Sheets("Car").Rows("1:20").EntireRow.Hidden = True
Case Else
Sheets("Car").Rows("1:20").EntireRow.Hidden = False
End Select
End Sub
of two cells and if the two cells = certain values then hide rows on a
different sheet.
For example if A12 = "BLUE" AND B16 = "DOG" then hide rows on sheet
"CAR" Else dont hide the rows.
I prefer to use the case select statement but the code below doesn't
work. Why?
'Case Select
'=====================================
Select Case testcase
Case UCase(Range("A12").Value = "Blue", Range("D27") = "Dog")
Sheets("Car").Rows("1:20").EntireRow.Hidden = True
Case Else
Sheets("Car").Rows("1:20").EntireRow.Hidden = False
End Select
End Sub