View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Help - hiding multiple sets of rows based on two different cells

Hi Andre,

Am Tue, 12 Jun 2012 08:23:25 +0000 schrieb Andredprz:

Please help. I have two cells on say Sheet 1 (cell C9 and cell C11).
If cell C9 < 0.01, then I want to hide rows 56:64 on Sheet2. At the
same time, if cell C11 < 0.01, I want to hide rows 65:78 on sheet 2). I
have compiled something based on what I read on the threads, but the
second IF seems to override the first IF e.g. If I type in
‘0’ in cell C9, it hides rows 56:64 on Sheet2, which is
correct. However, when I proceed and type in ‘0’ in cell
C11, it un-hides rows 56:64, even though cell C9 is still
‘0’.


try:

Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case Is = "$C$9"
Worksheets("Report").Rows("51:64").Rows.Hidden _
= Target < 0.01
Case Is = "$C$11"
Worksheets("Report").Rows("65:78").Rows.Hidden _
= Target < 0.01
End Select
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2