Vba - graph color same as cell color

Closed
osx04 Posts 1 Registration date Sunday September 22, 2013 Status Member Last seen September 22, 2013 - Sep 22, 2013 at 08:28 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Sep 24, 2013 at 11:57 AM
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 September 12, 2010 Status Moderator Last seen December 27, 2022 552
Sep 24, 2013 at 11:57 AM
Hi,

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

Best regards,
Trowa
0