
03-09-2016, 07:15 AM
|
Novice
|
|
Join Date: Mar 2016
Posts: 11
|
|
unhide hidden row
Hi Folks,
Can anyone help with this?
The current code hides rows E33:E58 and unhides one row at a time if the previous row is populated and works great, but now i need it to do the same to another set of rows too (rows E61:E86), i thought i would be able to copy the code and just change the cell address but no joy! any help would be great )
Thanks in advance
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("E33:E58")) Is Nothing Then
Application.ScreenUpdating = False
Dim LR As Long
LR = Range("E58").End(xlUp).Row
If Not IsEmpty(Range("E58")) Then
Range("E33:E58").EntireRow.Hidden = False
Exit Sub
End If
If Range("E58").EntireRow.Hidden = False Then
Range("E" & LR + 2, "E58").EntireRow.Hidden = True
Else
If Not IsEmpty(Target.Offset(1, 0)) Then
Target.End(xlDown).Offset(1, 0).EntireRow.Hidden = False
Else
Target.Offset(1, 0).EntireRow.Hidden = False
End If
End If
End If
End Sub]
Last edited by Pecoflyer; 03-11-2016 at 01:09 AM.
Reason: Added code tags
|