vipin30sep
New Member
- Joined
- Feb 14, 2019
- Messages
- 20
Hello,
I have a two dropdown based cells (C4 and C23) that have some values. Based on the selected dropdown condition, I need to hide/ unhide certain rows in another sheet (written macros for it). I'm using the following code, but only one works at a time. Could you please help as I'm stuck. Appreciate your help. Thanks!
I have a two dropdown based cells (C4 and C23) that have some values. Based on the selected dropdown condition, I need to hide/ unhide certain rows in another sheet (written macros for it). I'm using the following code, but only one works at a time. Could you please help as I'm stuck. Appreciate your help. Thanks!
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C4,C23")) Is Nothing Then
Select Case Target.Address(0, 0)
Case "C4"
If Target.Value = "Ecommerce" Then Call Ecommerce
If Target.Value = "Non-Commerce" Then Call NonCommerce
If Target.Value = "Ecommerce & Non-Commerce" Then Call Both
If Target.Value = "Select Ecommerce/Non-Commerce" Then Call Both
Case "C23"
If Target.Value = "Select Year" Then Call SelectYear
If Target.Value = "2020" Then Call Twentytwenty
If Target.Value = "2021" Then Call TwentyOne
If Target.Value = "2022" Then Call TwentyTwo
If Target.Value = "2023" Then Call TwentyThree
If Target.Value = "2024" Then Call TwentyFour
If Target.Value = "2025" Then Call TwentyFive
End Select
End If
End Sub