gustaphson
New Member
- Joined
- Apr 22, 2022
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Good Afternoon,
I am completing a workbook in which I need to hide rows based on a selection in the first sheet. The following code is included in the first sheet "S1" and it works. Sheet "S2" is identical to "S1" except for the fact that cell C6 on "S2" simply refrences C6 on "S1", and C6 on "S1" is a dropdown. The code on "S2" does not work, can anyone point me in the right direction? Thanks in advance!
I am completing a workbook in which I need to hide rows based on a selection in the first sheet. The following code is included in the first sheet "S1" and it works. Sheet "S2" is identical to "S1" except for the fact that cell C6 on "S2" simply refrences C6 on "S1", and C6 on "S1" is a dropdown. The code on "S2" does not work, can anyone point me in the right direction? Thanks in advance!
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("C6"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "6.33": Rows("21").EntireRow.Hidden = False
Case Is = "9.5": Rows("21").EntireRow.Hidden = True
Case Is = "12.5": Rows("21").EntireRow.Hidden = True
Case Is = "19": Rows("21").EntireRow.Hidden = True
Case Is = "25": Rows("21").EntireRow.Hidden = True
Case Is = "37.5": Rows("21").EntireRow.Hidden = True
Case Is = "SMA95": Rows("21").EntireRow.Hidden = True
Case Is = "SMA125": Rows("21").EntireRow.Hidden = True
Case Is = "4.75": Rows("21").EntireRow.Hidden = True
End Select
End If
End Sub
Last edited by a moderator: