April 2006
Beginner
1114 pages
98h 16m
English
Use the ChartColorFormat object to change the background or foreground colors using a color index or RGB value. Use the ChartFillFormat object’s BackColor or ForeColor property to get a reference to this object. The ChartColorFormat object has the following members:
Application Creator Parent RGB SchemeColor Type
The following code changes the background and foreground colors used in a gradient background for the chart area of the active chart:
Sub ChartColorFormat( )
Dim chrt As Chart, cf As ChartFillFormat
' Get the chart.
Set chrt = ActiveChart
' Get the chart area fill.
Set cf = chrt.ChartArea.Fill
' Make the fill visible.
cf.Visible = True
' Display a gradient fill.
cf.TwoColorGradient msoGradientFromCorner, 2
' Set backgroud/foreground colors.
cf.BackColor.SchemeColor = 17
cf.ForeColor.SchemeColor = 1
End SubRead now
Unlock full access