AW: Balkendiagramm färben in Abhängigkeit von Spalte
15.06.2017 11:52:56
Spalte
Hallo Nico,
setz dir einen breakpoint am anfang der schleife und geh step bei step durch und schau ob das was passiert, das ist, was du erwartest.
Ich hab dir eine Lösung präsentiert, Du hast einen 2. thread parallel mit eienr anderen Lösung. Deine Entscheidung, was Du nehmen willst
Ich hab es nochmal mit deiern neuen Liste durchlaufen lassen, war ein kleienr bug drin so gehts:
For i = 7 To 30
Debug.Print ThisWorkbook.Sheets("Projektplan").Cells(i, 1).Value
'Meilenstein
If InStr(1, ThisWorkbook.Sheets("Projektplan").Cells(i, 1).Value, "MS", vbTextCompare) 0 Then
With chtChart
.SeriesCollection(2).Points(i - 6).Format.Fill.ForeColor.RGB = RGB(255, 0, 0)
.SeriesCollection(3).Points(i - 6).Format.Fill.ForeColor.RGB = RGB(0, 255, 0)
End With
End If
'Phasen
If InStrRev(ThisWorkbook.Sheets("Projektplan").Cells(i, 1).Value, "-", -1, _
vbTextCompare) = Len(ThisWorkbook.Sheets("Projektplan").Cells(i, 1).Value) - 3 Then
With chtChart
.SeriesCollection(2).Points(i - 6).Format.Fill.ForeColor.RGB = RGB(255, 127, 0)
.SeriesCollection(3).Points(i - 6).Format.Fill.ForeColor.RGB = RGB(255, 255, 0)
End With
'Pakete
Else
With chtChart
.SeriesCollection(2).Points(i - 6).Format.Fill.ForeColor.RGB = RGB(255, 127, 0)
.SeriesCollection(3).Points(i - 6).Format.Fill.ForeColor.RGB = RGB(255, 255, 0)
End With
End If
Next i
Gruß
yummi