A
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 th
same time, if cell C11 < 0.01, I want to hide rows 65:78 on sheet 2).
have compiled something based on what I read on the threads, but th
second IF seems to override the first IF e.g. If I type i
‘0’ in cell C9, it hides rows 56:64 on Sheet2, which i
correct. However, when I proceed and type in ‘0’ in cel
C11, it un-hides rows 56:64, even though cell C9 is stil
‘0’. This is what I have written:
Sub Worksheet_Change(ByVal Target As Range)
If (Target.Row = 9) And (Target.Column = 3) And _
(Target < 0.01) Then
Worksheets("Report").Rows("51:64").Rows.Hidden = True
Else
Worksheets("Report").Rows("51:64").Rows.Hidden = False
End If
If (Target.Row = 11) And (Target.Column = 3) And _
(Target < 0.01) Then
Worksheets("Report").Rows("65:78").Rows.Hidden = True
Else
Worksheets("Report").Rows("65:78").Rows.Hidden = False
End If
End Sub
Please help, what am I doing wrong?
Thanks
Andr
If cell C9 < 0.01, then I want to hide rows 56:64 on Sheet2. At th
same time, if cell C11 < 0.01, I want to hide rows 65:78 on sheet 2).
have compiled something based on what I read on the threads, but th
second IF seems to override the first IF e.g. If I type i
‘0’ in cell C9, it hides rows 56:64 on Sheet2, which i
correct. However, when I proceed and type in ‘0’ in cel
C11, it un-hides rows 56:64, even though cell C9 is stil
‘0’. This is what I have written:
Sub Worksheet_Change(ByVal Target As Range)
If (Target.Row = 9) And (Target.Column = 3) And _
(Target < 0.01) Then
Worksheets("Report").Rows("51:64").Rows.Hidden = True
Else
Worksheets("Report").Rows("51:64").Rows.Hidden = False
End If
If (Target.Row = 11) And (Target.Column = 3) And _
(Target < 0.01) Then
Worksheets("Report").Rows("65:78").Rows.Hidden = True
Else
Worksheets("Report").Rows("65:78").Rows.Hidden = False
End If
End Sub
Please help, what am I doing wrong?
Thanks
Andr