Hi, I am trying to run a macro (which runs perfectly fine by itself, when a dropdown list is changed. Here is the code I have on the view code page
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$9" Then
If Range("E9").Value = "Promotion" Then
Rows("1:52").EntireRow.Hidden = False
Rows("53:77").EntireRow.Hidden = True
Rows("78:90").EntireRow.Hidden = False
ElseIf Range("E9").Value = "CRB" Then
Rows("37:67").EntireRow.Hidden = True
Rows("68:90").EntireRow.Hidden = False
ElseIf Range("E9").Value = "Off Cycle Salary Increase" Then
Rows("78:90").EntireRow.Hidden = False
Rows("53:68").EntireRow.Hidden = False
Rows("37:52").EntireRow.Hidden = True
Rows("69:75").EntireRow.Hidden = True
End If
End If
End Sub
Private Sub Worksheet_Change1(ByVal Target As Range)
If Not Intersect(Target, Range("E56:G56")) Is Nothing Then
Application.Run "searchdata3"
End If
End Sub
The second dropdown list highlighted in red, is what is not working for me. Does anyone know what I need to change in the above to have the macro run, when the dropdown list is changed?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$9" Then
If Range("E9").Value = "Promotion" Then
Rows("1:52").EntireRow.Hidden = False
Rows("53:77").EntireRow.Hidden = True
Rows("78:90").EntireRow.Hidden = False
ElseIf Range("E9").Value = "CRB" Then
Rows("37:67").EntireRow.Hidden = True
Rows("68:90").EntireRow.Hidden = False
ElseIf Range("E9").Value = "Off Cycle Salary Increase" Then
Rows("78:90").EntireRow.Hidden = False
Rows("53:68").EntireRow.Hidden = False
Rows("37:52").EntireRow.Hidden = True
Rows("69:75").EntireRow.Hidden = True
End If
End If
End Sub
Private Sub Worksheet_Change1(ByVal Target As Range)
If Not Intersect(Target, Range("E56:G56")) Is Nothing Then
Application.Run "searchdata3"
End If
End Sub
The second dropdown list highlighted in red, is what is not working for me. Does anyone know what I need to change in the above to have the macro run, when the dropdown list is changed?