Thread: auto hide
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default auto hide

Private Sub Worksheet_Calculate()
'Hide rows with formulas that return negatives
Dim cell As Range
On Error GoTo endit
Application.EnableEvents = False
Application.ScreenUpdating = False
With Me.UsedRange
.Rows.Hidden = False
For Each cell In .Columns(1).SpecialCells(xlCellTypeFormulas)
If cell.Value < 0 Then cell.EntireRow.Hidden = True
Next cell
End With
endit:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP


On Thu, 29 Jan 2009 22:26:01 -0800, Chad
wrote:

Is there a way to auto hide a row based on the contents of a certain column
in the row?

For Example:
Auto hide any row where column A has a - for the value of the cell.

I believe value is the right term here because the reason I ask the cell
will contain a formula that may result in a - if so I want the row hidden.