View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Hide Rows If Condition True

You need a change event macro for that, something like this:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim ucell As Range, urows As Range
rownum = ActiveSheet.UsedRange.Rows.Count
Set urows = Range("C2:C" & ActiveSheet.UsedRange.Rows.Count) 'change
"C" to your specific column
For Each ucell In urows
ucell.EntireRow.Hidden = (ucell = 0)
Next ucell
End Sub

Regards,
Stefi


€˛wilbursj€¯ ezt Ć*rta:

Hi
Is it possible to auto-hide a row if a condition is met. Ie If the value of
a specifc cell in that row is 0, i do not want the row to show, so either
hide it or make row hright minimal. If value changes, i would want it to
unhide or increase row height to make it visible.
Thanks