lalahaedong
New Member
I have a formula in cell A2 that provides a count from another worksheet. I would like to automatically unhide the number of rows from the count. The code that I wrote only unhides after selecting the cell and hit enter. What am I doing wrong, why isn't my code working?
MOD EDIT: Added Code Tags. Please use them when posting code snippets!
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$2" Then Exit Sub
Application.EnableEvents = False
Range("a6:A35").EntireRow.Hidden = True
Range(Range("A6"), Range("A6").Offset(Range("A2").Value - 1, 0)).EntireRow.Hidden = False
Application.EnableEvents = False
End Sub
Last edited by a moderator: