Thread: Hiding rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
 
Posts: n/a
Default Hiding rows

Hi not bright

You could try this:

Right-click the tab of your sheet, click View Code and paste:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
Application.ScreenUpdating = False
For Each c In Range("A2:A" &
Cells.SpecialCells(xlCellTypeLastCell).Row) 'best method?
If c.Value = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next
Application.ScreenUpdating = True
End Sub

I'm not sure if the range finder is the best for you (it finds the last
row used in the entire sheet) and you may be better off substituting

Range("A2:A" & Cells.SpecialCells(xlCellTypeLastCell).Row)

with something like

Range("A2:A100") for whatever your actual range mght be.

Regards

Steve