Current problem: I have a dropdown list populated via data validation with static values. The range of this dropdown list is "G2". I am triggering a worksheet change event that was coded in "ThisWorkbook" whenever user makes a selection. However, this event is being triggered every time any cell in that worksheet changes (duh, of course it will). For e.g., towards the end of the code below, I am manipulating a few things and writing it to a different cell range. And because of that, the control is going into an indefinite loop. I am out of ideas. How can I localize the event for dropdown selection only?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim sProgramIncrement, sSprintCycle, sSprintStart, sSprintEnd As String
sProgramIncrement = Split(Left(Range("G2"), 7), ".")(0)
sSprintCycle = Split(Left(Range("G2"), 7), ".")(1)
sSprintStart = Split(Right(Range("G2"), 7), "-")(0)
sSprintEnd = Split(Right(Range("G2"), 7), "-")(1)
Select Case Range("G2")
Case "PI1.S01 J01-J14"
If sProgramIncrement = "PI1" And Left(sSprintStart, 1) = "J" Then sSprintStartMonth = "01"
If sProgramIncrement = "PI1" And Left(sSprintEnd, 1) = "J" Then sSprintEndMonth = "01"
If Left(sSprintStart, 1) = "F" Then sSprintStartMonth = "02"
If Left(sSprintEnd, 1) = "F" Then sSprintEndMonth = "02"
If sProgramIncrement = "PI1" And Left(sSprintStart, 1) = "M" Then sSprintStartMonth = "03"
If sProgramIncrement = "PI2" And sSprintCycle = "S01" And Left(sSprintStart, 1) = "M" Then sSprintStartMonth = "03"
If sProgramIncrement = "PI2" And Left(sSprintStart, 1) = "A" Then sSprintStartMonth = "04"
If Left(sSprintStart, 1) = "M" Then sSprintStartMonth = "05"
If sProgramIncrement = "PI2" And Left(sSprintStart, 1) = "J" Then sSprintStartMonth = "06"
If sProgramIncrement = "PI3" And Left(sSprintStart, 1) = "J" Then sSprintStartMonth = "07"
If sProgramIncrement = "PI3" And Left(sSprintStart, 1) = "A" Then sSprintStartMonth = "08"
If Left(sSprintStart, 1) = "S" Then sSprintStartMonth = "09"
If Left(sSprintEnd, 1) = "S" Then sSprintEndMonth = "09"
If Left(sSprintStart, 1) = "O" Then sSprintStartMonth = "10"
If Left(sSprintEnd, 1) = "O" Then sSprintEndMonth = "10"
If Left(sSprintStart, 1) = "N" Then sSprintStartMonth = "11"
If Left(sSprintEnd, 1) = "N" Then sSprintEndMonth = "11"
If Left(sSprintStart, 1) = "D" Then sSprintStartMonth = "12"
If Left(sSprintEnd, 1) = "D" Then sSprintEndMonth = "12"
Worksheets("KPIs").Range("G3") = sSprintStartMonth & "/" & Right(sSprintStart, 2) & "/" & "20"
Worksheets("KPIs").Range("I3") = sSprintStartMonth & "/" & Right(sSprintEnd, 2) & "/" & "20"
End Select
End Sub