Hi all:
I have the following code which works beautifully for all the cells in the Range, except I need to add the following condition:
For every Row in Range e19:22 whose Value equals the row above it, Hide the Row. (This should not affect the other rows in the C Column Range list). The rows always begin as hidden. Can anyone help?
Private Sub Worksheet_Calculate()
Dim Cell As Range
On Error GoTo ErrHandler
For Each Cell In Range("e18:e22,C41:C42,C44:C49,C62")
Application.ScreenUpdating = False
Application.EnableEvents = False
ThisWorkbook.Sheets("Select Ren").Unprotect
If Cell.Value > 0 Then
Cell.EntireRow.Hidden = False
Else
Cell.EntireRow.Hidden = True
End If
Next
ErrHandler:
Application.ScreenUpdating = True
Application.EnableEvents = True
ThisWorkbook.Sheets("Select Ren").Protect
End Sub
Thanks so much for any input.
LB in GA
I have the following code which works beautifully for all the cells in the Range, except I need to add the following condition:
For every Row in Range e19:22 whose Value equals the row above it, Hide the Row. (This should not affect the other rows in the C Column Range list). The rows always begin as hidden. Can anyone help?
Private Sub Worksheet_Calculate()
Dim Cell As Range
On Error GoTo ErrHandler
For Each Cell In Range("e18:e22,C41:C42,C44:C49,C62")
Application.ScreenUpdating = False
Application.EnableEvents = False
ThisWorkbook.Sheets("Select Ren").Unprotect
If Cell.Value > 0 Then
Cell.EntireRow.Hidden = False
Else
Cell.EntireRow.Hidden = True
End If
Next
ErrHandler:
Application.ScreenUpdating = True
Application.EnableEvents = True
ThisWorkbook.Sheets("Select Ren").Protect
End Sub
Thanks so much for any input.
LB in GA