Vba - graph color same as cell color

Closed
osx04 Posts 1 Registration date Sunday 22 September 2013 Status Member Last seen 22 September 2013 - 22 Sep 2013 à 08:28
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 24 Sep 2013 à 11:57
hi,
i am creating a project of my own using ms excel 2007 and i need help on this. i want to put the cell color to the graph that i am making using vba code. how the source cell that i'm getting the color was in 'conditional formatting'.

i'm currently using this code however it wont copy the color of the source cell unless i manually do it.

Sub ColorCharts()
For Each ch In ActiveSheet.ChartObjects
For Each ser In ch.Chart.SeriesCollection
s = Split(ser.Formula, ",")
For i = 1 To UBound(ser.Values)
ser.Points(i).Interior.Color = Range(s(2)).Cells(i).Interior.Color
Next i
Next ser
Next ch
End Sub


help please,

thank you
Related:

1 response

TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 555
24 Sep 2013 à 11:57
Hi,

I guess you have to use code instead of conditional formatting to solve your issue.

Best regards,
Trowa