1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| Public Sub listbox1_Update()
Dim X As Integer, i As Integer, j As Integer
Dim Tableau(13), Plage(13)
If ComboBox1.Value = "Column 3D" Then
For i = Cht.SeriesCollection.Count To 1 Step -1
Cht.SeriesCollection.Delete i - 1
Next i
For i = 2 To 13
Tableau(i) = Sheets("calculation").Cells(2, 2 + i)
Next i
With Cht
.HasLegend = True
.Legend.Position = chLegendPositionBottom
End With
For j = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(j) = True Then
If Cht.SeriesCollection.Count > 0 Then Cht.SeriesCollection.Add
For i = 2 To 13
Plage(i) = Sheets("calculation").Cells(j + 3, 2 + i)
Next i
With Cht
.SetData C.chDimCategories, C.chDataLiteral, Tableau
.SeriesCollection(X).Caption = Sheets("calculation").Cells(j + 3, 1)
.SeriesCollection(X).SetData C.chDimValues, C.chDataLiteral, Plage
' .SeriesCollection(x).Interior.Color = 50000 * (j + 1)
.SeriesCollection(X).Interior.Color = 90000 * (j + 3)
.SeriesCollection(X).Line.Color = 90000 * (j + 3)
End With
X = X + 1
Erase Plage
End If
Next j
Else
For i = Cht.SeriesCollection.Count To 1 Step -1
Cht.SeriesCollection.Delete i - 1
Next i
For i = 1 To 13
Tableau(i) = Sheets("calculation").Cells(2, 2 + i)
Next i
With Cht
.HasLegend = True
.Legend.Position = chLegendPositionBottom
End With
For j = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(j) = True Then
If Cht.SeriesCollection.Count > 0 Then Cht.SeriesCollection.Add
For i = 1 To 13
Plage(i) = Sheets("calculation").Cells(j + 3, 2 + i)
Next i
With Cht
.SetData C.chDimCategories, C.chDataLiteral, Tableau
.SeriesCollection(X).Caption = Sheets("calculation").Cells(j + 3, 1)
.SeriesCollection(X).SetData C.chDimValues, C.chDataLiteral, Plage
' .SeriesCollection(x).Interior.Color = 50000 * (j + 1)
.SeriesCollection(X).Interior.Color = 90000 * (j + 3)
.SeriesCollection(X).Line.Color = 90000 * (j + 3)
End With
X = X + 1
Erase Plage
End If
Next j
End If
End Sub |
Partager