auto hide
This is perfect and works great for me. However I need to protect my sheet
and when I do the code does not work. I make it so that users can format
rows and cells but still it ceases to work. Can I get this to work on
protected sheets?
"Gord Dibben" wrote:
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.
|