tlc53
Active Member
- Joined
- Jul 26, 2018
- Messages
- 402
Hi,
Column B is a description field where the user enters data. To reduce the visible size of the table, I want to hide rows until they are needed.
I would like, when they enter something in B20, 5 rows below are unhidden. Then when they get to B25 and enter data, another 5 rows are unhidden. Again at B30.
My current VBA code only unhides the one row below. Can someone please help amend the code, so it unhides 5 rows at a time?
Thanks so much!
Column B is a description field where the user enters data. To reduce the visible size of the table, I want to hide rows until they are needed.
I would like, when they enter something in B20, 5 rows below are unhidden. Then when they get to B25 and enter data, another 5 rows are unhidden. Again at B30.
My current VBA code only unhides the one row below. Can someone please help amend the code, so it unhides 5 rows at a time?
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Intersect(Target, [B20:B20,B25:B25,B30:B30])
If Not rng Is Nothing Then rng(2, 1).EntireRow.Hidden = False
End Sub
Thanks so much!