Hi,
I'm a newbie in Excel. Could you help me to code for hidding rows that are non consecutives ?
My cell A1 is a dropdown menu, with the choice between Value1 and Value2.
I found this (adapted to be simple), wich is working :
But the problem : I want to add another dropdown choice, in another cell, let's say in A2.
How can I make it to enrich my code ??
I have been busy for so long ...Thanks !
I'm a newbie in Excel. Could you help me to code for hidding rows that are non consecutives ?
My cell A1 is a dropdown menu, with the choice between Value1 and Value2.
I found this (adapted to be simple), wich is working :
Code:
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("$A$1")) Is Nothing Then
With Range("$A$1")
Range("10:14").EntireRow.Hidden = .Value = "Value1"
Range("15:20").EntireRow.Hidden = .Value = "Value2"
Range("21:25").EntireRow.Hidden = .Value = "Value1"
Range("26:30").EntireRow.Hidden = .Value = "Value2"
Range("31:35").EntireRow.Hidden = .Value = "Value1"
Range("36:40").EntireRow.Hidden = .Value = "Value2"
Range("41:45").EntireRow.Hidden = .Value = "Value1"
Range("46:50").EntireRow.Hidden = .Value = "Value2"
End With
End If
End Sub
But the problem : I want to add another dropdown choice, in another cell, let's say in A2.
How can I make it to enrich my code ??
I have been busy for so long ...Thanks !