Hello all,
I've looked at a few threads but haven't been able to fix my code to do what I want.
I'm writing a basic script to enter the text "Please Select..." in the adjoining criteria fields once a person selects an initial criteria to prompt them to select level 2 and level 3 categories so risk and opportunity data flows correctly through my summary P&L based on 3 levels of category. The selections will reset and display "Please Select..." every time a drop down value has changed so that the conditional drop downs don't stay frozen when a level 1 or level 2 category has been changed. In addition, once a person has selected a category and entered the $ Impact on the same row, I want the risk category drop down cell next to the $ Impact to display "Please Select..." so that they can assign a risk category to the number value they've entered or changed. Here's what I've got, I tried playing with multiple elseifs and application.enableevents = true/false to accomplish this but it usually ends the script after one change event. I want to combine these two change events so that any change in columns b, c, and g trigger the events I've described above. Any help would be appreciated.
I've looked at a few threads but haven't been able to fix my code to do what I want.
I'm writing a basic script to enter the text "Please Select..." in the adjoining criteria fields once a person selects an initial criteria to prompt them to select level 2 and level 3 categories so risk and opportunity data flows correctly through my summary P&L based on 3 levels of category. The selections will reset and display "Please Select..." every time a drop down value has changed so that the conditional drop downs don't stay frozen when a level 1 or level 2 category has been changed. In addition, once a person has selected a category and entered the $ Impact on the same row, I want the risk category drop down cell next to the $ Impact to display "Please Select..." so that they can assign a risk category to the number value they've entered or changed. Here's what I've got, I tried playing with multiple elseifs and application.enableevents = true/false to accomplish this but it usually ends the script after one change event. I want to combine these two change events so that any change in columns b, c, and g trigger the events I've described above. Any help would be appreciated.
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
Dim Category As Range
Set Category = ActiveSheet.Range("B3:C59")
If Application.Intersect(Target, Category) Is Nothing Then
Exit Sub
ElseIf Application.Intersect(Target, Category).Address = Target.Address Then
Target.Offset(0, 1).Range("a1").Value = "Please Select..."
If Application.Intersect(Target, Category).Value = "" Then
Target.Offset(0, 0).Range("a1").Value = "Please Select..."
End If
End If
Sub Worksheet_Change(ByVal Target As Range)
Dim Category As Range
Set Impact = ActiveSheet.Range("G3:G59")
If Application.Intersect(Target, Impact) Is Nothing Then
Exit Sub
ElseIf Application.Intersect(Target, Impact).Address = Target.Address Then
Target.Offset(0, 1).Range("a1").Value = "Please Select..."
If Application.Intersect(Target, Impact).Value = "" Then
Target.Offset(0, 0).Range("a1").Value = "Please Select..."
End If
End If
End Sub