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

I've used things like this before, but don't really like it because once
it's hidden you have to manually unhide the rows to change the value. On
issues like this I generally try for a one-time solution. A change event
doesn't give you that flexibility.

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM


wrote in message
oups.com...
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