RawlinsCross
Active Member
- Joined
- Sep 9, 2016
- Messages
- 437
This should be fairly straight forward but I'm missing something:
I have a combobox with 13 items that reference a different column of data. I'm trying to tell excel to graph based on the index value of that combobox. It's working but only with the first selection (i.e. index = 0). here's the portion of the code in question.
I have a combobox with 13 items that reference a different column of data. I'm trying to tell excel to graph based on the index value of that combobox. It's working but only with the first selection (i.e. index = 0). here's the portion of the code in question.
Code:
If ChartIndex1 = 0 Then
Set ChartData1 = Worksheets("212-R365").Range("F" & r.Row & ":F" & rn1)
ElseIf ChartIndex1 = 1 Then
Set ChartData1 = Worksheets("212-R365").Range("H" & r.Row & ":H" & rn1)
ElseIf ChartIndex1 = 2 Then
Set ChartData1 = Worksheets("212-R365").Range("AK" & r.Row & ":AK" & rn1)
ElseIf ChartIndex1 = 3 Then
Set ChartData1 = Worksheets("212-R365").Range("EA" & r.Row & ":EA" & rn1)
ElseIf ChartIndex1 = 4 Then
Set ChartData1 = Worksheets("212-R365").Range("U" & r.Row & ":U" & rn1)
ElseIf ChartIndex1 = 5 Then
Set ChartData1 = Worksheets("212-R365").Range("AL" & r.Row & ":AL" & rn1)
ElseIf ChartIndex1 = 6 Then
Set ChartData1 = Worksheets("212-R365").Range("P" & r.Row & ":P" & rn1)
ElseIf ChartIndex1 = 7 Then
Set ChartData1 = Worksheets("212-R365").Range("AM" & r.Row & ":AM" & rn1)
ElseIf ChartIndex1 = 8 Then
Set ChartData1 = Worksheets("212-R365").Range("Q" & r.Row & ":Q" & rn1)
ElseIf ChartIndex1 = 9 Then
Set ChartData1 = Worksheets("212-R365").Range("R" & r.Row & ":R" & rn1)
ElseIf ChartIndex1 = 10 Then
Set ChartData1 = Worksheets("212-R365").Range("D" & r.Row & ":D" & rn1)
ElseIf ChartIndex1 = 11 Then
Set ChartData1 = Worksheets("212-R365").Range("T" & r.Row & ":T" & rn1)
ElseIf ChartIndex1 = 12 Then
Set ChartData1 = Worksheets("212-R365").Range("S" & r.Row & ":S" & rn1)
End If