B
Bull
I have this code and keep getting the error, ..I have notated where
the error hits, can someone help me out? Basically, when a value is
selected from a dropdown on a sheet, values are filled in to assigned
cells based on the dropdown selection.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static rOldCell As Range
If Not rOldCell Is Nothing Then
If Not Intersect(rOldCell, Range("I2")) Is Nothing Then
If Range("I2").Value Like "SPOKANE" Then _
Range("C32").Value =
Sheets("ERRORREPORT").Range("B22").Value
Range("E32").Value =
Sheets("ERRORREPORT").Range("C22").Value
Range("G32").Value =
Sheets("ERRORREPORT").Range("D22").Value
Range("I32").Value =
Sheets("ERRORREPORT").Range("E22").Value
Range("K32").Value =
Sheets("ERRORREPORT").Range("F22").Value
Range("M32").Value =
Sheets("ERRORREPORT").Range("G22").Value
Range("O32").Value =
Sheets("ERRORREPORT").Range("H22").Value
Range("Q32").Value =
Sheets("ERRORREPORT").Range("I22").Value
Range("S32").Value =
Sheets("ERRORREPORT").Range("J22").Value
Range("V32").Value =
Sheets("ERRORREPORT").Range("K22").Value
Range("X32").Value =
Sheets("ERRORREPORT").Range("L22").Value
Range("Z32").Value =
Sheets("ERRORREPORT").Range("M22").Value
Range("AB32").Value =
Sheets("ERRORREPORT").Range("N22").Value
Range("AA11").Value =
Sheets("ERRORREPORT").Range("O22").Value
Range("AA12").Value =
Sheets("ERRORREPORT").Range("P22").Value
Range("AA13").Value =
Sheets("ERRORREPORT").Range("Q22").Value
End If
If Range("I2").Value Like "OPPORTUNITY" Then _
Range("C32").Value =
Sheets("ERRORREPORT").Range("B23").Value
Range("E32").Value =
Sheets("ERRORREPORT").Range("C23").Value
Range("G32").Value =
Sheets("ERRORREPORT").Range("D23").Value
Range("I32").Value =
Sheets("ERRORREPORT").Range("E23").Value
Range("K32").Value =
Sheets("ERRORREPORT").Range("F23").Value
Range("M32").Value =
Sheets("ERRORREPORT").Range("G23").Value
Range("O32").Value =
Sheets("ERRORREPORT").Range("H23").Value
Range("Q32").Value =
Sheets("ERRORREPORT").Range("I23").Value
Range("S32").Value =
Sheets("ERRORREPORT").Range("J23").Value
Range("V32").Value =
Sheets("ERRORREPORT").Range("K23").Value
Range("X32").Value =
Sheets("ERRORREPORT").Range("L23").Value
Range("Z32").Value =
Sheets("ERRORREPORT").Range("M23").Value
Range("AB32").Value =
Sheets("ERRORREPORT").Range("N23").Value
Range("AA11").Value =
Sheets("ERRORREPORT").Range("O23").Value
Range("AA12").Value =
Sheets("ERRORREPORT").Range("P23").Value
Range("AA13").Value =
Sheets("ERRORREPORT").Range("Q23").Value
End If
End If<<<<<----Error Hits Here
End If
Set rOldCell = Target
End Sub
the error hits, can someone help me out? Basically, when a value is
selected from a dropdown on a sheet, values are filled in to assigned
cells based on the dropdown selection.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static rOldCell As Range
If Not rOldCell Is Nothing Then
If Not Intersect(rOldCell, Range("I2")) Is Nothing Then
If Range("I2").Value Like "SPOKANE" Then _
Range("C32").Value =
Sheets("ERRORREPORT").Range("B22").Value
Range("E32").Value =
Sheets("ERRORREPORT").Range("C22").Value
Range("G32").Value =
Sheets("ERRORREPORT").Range("D22").Value
Range("I32").Value =
Sheets("ERRORREPORT").Range("E22").Value
Range("K32").Value =
Sheets("ERRORREPORT").Range("F22").Value
Range("M32").Value =
Sheets("ERRORREPORT").Range("G22").Value
Range("O32").Value =
Sheets("ERRORREPORT").Range("H22").Value
Range("Q32").Value =
Sheets("ERRORREPORT").Range("I22").Value
Range("S32").Value =
Sheets("ERRORREPORT").Range("J22").Value
Range("V32").Value =
Sheets("ERRORREPORT").Range("K22").Value
Range("X32").Value =
Sheets("ERRORREPORT").Range("L22").Value
Range("Z32").Value =
Sheets("ERRORREPORT").Range("M22").Value
Range("AB32").Value =
Sheets("ERRORREPORT").Range("N22").Value
Range("AA11").Value =
Sheets("ERRORREPORT").Range("O22").Value
Range("AA12").Value =
Sheets("ERRORREPORT").Range("P22").Value
Range("AA13").Value =
Sheets("ERRORREPORT").Range("Q22").Value
End If
If Range("I2").Value Like "OPPORTUNITY" Then _
Range("C32").Value =
Sheets("ERRORREPORT").Range("B23").Value
Range("E32").Value =
Sheets("ERRORREPORT").Range("C23").Value
Range("G32").Value =
Sheets("ERRORREPORT").Range("D23").Value
Range("I32").Value =
Sheets("ERRORREPORT").Range("E23").Value
Range("K32").Value =
Sheets("ERRORREPORT").Range("F23").Value
Range("M32").Value =
Sheets("ERRORREPORT").Range("G23").Value
Range("O32").Value =
Sheets("ERRORREPORT").Range("H23").Value
Range("Q32").Value =
Sheets("ERRORREPORT").Range("I23").Value
Range("S32").Value =
Sheets("ERRORREPORT").Range("J23").Value
Range("V32").Value =
Sheets("ERRORREPORT").Range("K23").Value
Range("X32").Value =
Sheets("ERRORREPORT").Range("L23").Value
Range("Z32").Value =
Sheets("ERRORREPORT").Range("M23").Value
Range("AB32").Value =
Sheets("ERRORREPORT").Range("N23").Value
Range("AA11").Value =
Sheets("ERRORREPORT").Range("O23").Value
Range("AA12").Value =
Sheets("ERRORREPORT").Range("P23").Value
Range("AA13").Value =
Sheets("ERRORREPORT").Range("Q23").Value
End If
End If<<<<<----Error Hits Here
End If
Set rOldCell = Target
End Sub