Chart Farbe funktioniert nicht mehr in Excel 2010
27.05.2013 09:18:54
Rosenwasser
Unterstehenden Code (welche von hier kommt) hat in Excel 2003 immer funktioniert.
Beim umschalten nach Excel 2010 bleibt mein Programm hängen auf Linie "ActiveChart.SeriesCollection(1).Select"
Ich habe schon auf Internet gesucht aber nichts gefunden.
Wer kann mir hier weiter helfen?
Vielen dank & Gruß,
Benny
Sub BalkenKleur()
Dim i As Integer
Dim x As Integer
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With ActiveChart.ChartGroups(1)
.Overlap = 0
.GapWidth = 0
.HasSeriesLines = False
.VaryByCategories = False
End With
On Error GoTo ERRORHANDLER
Application.ScreenUpdating = False
ActiveChart.SeriesCollection(1).ApplyDataLabels Type:=xlDataLabelsShowValue, _
AutoText:=True
For x = 1 To ActiveChart.SeriesCollection.Count
For i = 1 To ActiveChart.SeriesCollection(x).Points.Count
ActiveChart.SeriesCollection(x).Points(i).DataLabel.Select
If CDbl(Selection.Text) = "5" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 3
ElseIf CDbl(Selection.Text) >= "4,5" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 3
ElseIf CDbl(Selection.Text) >= "4" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 22
ElseIf CDbl(Selection.Text) >= "3,5" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 46
ElseIf CDbl(Selection.Text) >= "3" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 45
ElseIf CDbl(Selection.Text) >= "2,5" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 40
ElseIf CDbl(Selection.Text) >= "2" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 44
ElseIf CDbl(Selection.Text) >= "1,5" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 36
ElseIf CDbl(Selection.Text) >= "1" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 50
ElseIf CDbl(Selection.Text) >= "0,5" Then
ActiveChart.SeriesCollection(x).Points(i).Interior.ColorIndex = 43
End If
Next i
Next x
ActiveChart.SeriesCollection(1).ApplyDataLabels Type:=xlDataLabelsShowNone, _
AutoText:=True
Application.ScreenUpdating = True
Exit Sub
ERRORHANDLER:
MsgBox "De procedure is vastgelopen"
End Sub