View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cchubba cchubba is offline
external usenet poster
 
Posts: 2
Default Conditional Hide Rows Macro

I want a macro to do a conditional hide automatically based on another
value in another cell.

For example:

If Cell A1 = "Yes" then hide rows 20:23
If Cell A1 = "No" then do not hide rows 20:23


The closest thing i can find is the below example which hides the row
based on the value (in the same row) in column T




Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Range("T" & Target.Row).Value
Case Is = "Y"
Target.EntireRow.Hidden = True
Case Is = "N"
Target.EntireRow.Hidden = False
End Select
End Sub