Thread: Hide Rows
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
newguy newguy is offline
external usenet poster
 
Posts: 40
Default Hide Rows

I am trying to get this code to work where if a user enters an X in a
range of cells a corresponding group of rows is hidden further down in
the worksheet and I don't know what I am doing wrong.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B5") = "X" Then
Range("B9:B15").EntireRow.Hidden = True
Else
Range("B9:B15").EntireRow.Hidden = False
End If

End Sub