View Single Post
  #2   Report Post  
John Mansfield
 
Posts: n/a
Default

If you are working with an embedded chart, select the outside of the chart
and run this macro:

Sub ChangeColors1()
ActiveChart.ChartArea.Interior.ColorIndex = 8
ActiveChart.PlotArea.Interior.ColorIndex = 7
End Sub

To change the ChartArea and PlotArea colors for all embedded charts on the
worksheet, you can use something like this:

Sub ChangeColors2()
Dim ChtObj As ChartObject
For Each ChtObj In ActiveSheet.ChartObjects
ChtObj.Interior.ColorIndex = 4
ChtObj.Chart.PlotArea.Interior.ColorIndex = 3
Next ChtObj
End Sub

If you're using a chart sheet, try:

Sub ChangeColors3()
Dim Cht As Chart
Set Cht = Sheets("Chart2")
Cht.ChartArea.Interior.ColorIndex = 8
Cht.PlotArea.Interior.ColorIndex = 7
End Sub

--
Regards,
John Mansfield
http://www.pdbook.com


"Cenk Ursavas via OfficeKB.com" wrote:

HOw can I change the background and foreground color of an excel graph?
I tried :
------------------------------------
With myChart.ChartArea.Fill
.Visible = True
.ForeColor.SchemeColor = 15
.BackColor.SchemeColor = 17
End With
------------------------------------
the background color changes but the foreground does not change...Does
foreground here mean the grey area because thats the color I want to change.
Thanks

--
Message posted via http://www.officekb.com