S
Shelly
Hello, I've been searching through these forums since last night, but just
can't figure this out. I have a cell with data validation, and 2 values
"Migration" and "Transition".
If the cell (B15) is blank, I want all the rows to be hidden (16:32)
If the cell (B15) equals Migration, I want to hide rows 24:32
If the cell (B15) equals Transition, I want to hide rows 17:24
Below is what I have... but I must be missing something.
----------------
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Range("B15").Value = "" Then
Range(Rows(16), Rows(32)).EntireRow.Hidden = True
ElseIf Range("B15").Value = "Migration" Then
Range(Rows(17), Rows(24)).EntireRow.Hidden = False:
Range(Rows(25), Rows(32)).EntireRow.Hidden = True
ElseIf Range("B15").Value = "Transition" Then
Range(Rows(17), Rows(24)).EntireRow.Hidden = True:
Range(Rows(25), Rows(32)).EntireRow.Hidden = False
End If
Application.ScreenUpdating = True
End Sub
can't figure this out. I have a cell with data validation, and 2 values
"Migration" and "Transition".
If the cell (B15) is blank, I want all the rows to be hidden (16:32)
If the cell (B15) equals Migration, I want to hide rows 24:32
If the cell (B15) equals Transition, I want to hide rows 17:24
Below is what I have... but I must be missing something.
----------------
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Range("B15").Value = "" Then
Range(Rows(16), Rows(32)).EntireRow.Hidden = True
ElseIf Range("B15").Value = "Migration" Then
Range(Rows(17), Rows(24)).EntireRow.Hidden = False:
Range(Rows(25), Rows(32)).EntireRow.Hidden = True
ElseIf Range("B15").Value = "Transition" Then
Range(Rows(17), Rows(24)).EntireRow.Hidden = True:
Range(Rows(25), Rows(32)).EntireRow.Hidden = False
End If
Application.ScreenUpdating = True
End Sub