View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
George George is offline
external usenet poster
 
Posts: 347
Default Hiding Rows if a Field Value is set to 0%

Thanks! That did it.

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("D1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value = 0 Then
Rows("6:9").Hidden = True
Else
Rows("6:9").Hidden = False
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Mon, 1 Sep 2008 13:39:02 -0700, George
wrote:

Thanks but I don't think that will work for me.
I have a field (D1) where the user can enter a percentage.
That value drives formulas on 16 other fields (4Rx4C) which are always 0 if
the field value is 0% (the default value). Therefore, they should remain
hidden.
BUT, if the user enters anything other than 0%, I want 16 other fields to
appear.

"Pete_UK" wrote:

Use Autofilter on the column that contains the percentage - choose
Custom, then Not Equal To, then 0 (zero).

Hope this helps.

Pete

On Sep 1, 8:58 pm, George wrote:
Hello,
I have a worksheet with some rows that are only applicable if the percentage
value in another field is greater than 0%. Otherwise, I want those rows to be
hidden.
Can anyone help me figure out how to do this?

Thanks very much!