Private Sub Worksheet_Change(ByVal Target As Range)
'Do nothing unless we changed something in rows 17:1000
'Adjust if needed
If Intersect(Target,Range("17:1000")) Is Nothing Then Exit Sub
'Unhide row below changed cell
Target.Offset(1).EntireRow.Hidden = False
End Sub
Sub UnhideRows()
Dim NumRows As Long
NumRows = Range("B17").Value
Application.ScreenUpdating = False
'First, hide all the rows
Range("18:1018").EntireRow.Hidden = True
'Next, check if we need to unhide anything
If NumRows > 0 Then
Range("A18").Resize(NumRows).EntireRow.Hidden = False
End If
Application.ScreenUpdating = True
End Sub