Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto hide/Unhide columns Vespaguy Excel Worksheet Functions 5 August 25th 07 01:08 AM
Auto Hide Columns when... Jase4now Excel Discussion (Misc queries) 0 March 28th 07 07:02 PM
Auto Hide Columns Phil Osman Excel Discussion (Misc queries) 6 September 13th 06 07:32 PM
Auto Hide Columns & Rows appeng Excel Discussion (Misc queries) 2 March 25th 05 04:43 PM
AUTO HIDE ROWS Alan Excel Worksheet Functions 1 November 27th 04 09:13 AM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"