Is there a way to have two of these options in one spreadsheet? I have spreadsheet where it is working fine, but i am trying to add another hide a different set of rows? Does the code need a different name?
Example of code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A9")) Is Nothing Then
Rows("11:24").Hidden = True
For i = 1 To Range("A9").Value
Rows(i + 9).Hidden = False
Next i
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A28")) Is Nothing Then
Rows("30:24").Hidden = True
For i = 1 To Range("A28").Value
Rows(i + 29).Hidden = False
Next i
End If
End Sub
Bookmarks