XL5: Cannot Set Chart Data Marker Color Using Macro |
In Microsoft Excel, when the background or foreground color of a chart data marker is set to none, you cannot change the color of that data marker with a macro.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel for Windows version 5.0c.
To set the color of a chart data marker using a macro, when the color of the chart marker is set to none, use the ClearFormats method in a Visual Basic procedure, or the Clear function in a Microsoft Excel version 4.0 macro as in the following examples:
' Set Series 1 data marker background color to red
Charts(1).SeriesCollection(1).ClearFormats
Charts(1).SeriesCollection(1).MarkerBackgroundColorIndex = 3
' Set Series 1 data markers foreground color to red
Charts(1).SeriesCollection(1).ClearFormats
Charts(1).SeriesCollection(1).MarkerForegroundColorIndex = 3
=SELECT("S1")
=CLEAR(2)
=PATTERNS(,,,,0,,,3,,)
The following example clears the Series 1 data marker formatting on
the active chart, and sets the foreground color to red:
=SELECT("S1")
=CLEAR(2)
=PATTERNS(,,,,0,,3,,,)
Note that when you use the above examples, the drawback of using the
ClearFormats method and the Clear function is that all the formatting for
the selected data markers is reset. Because of this resetting, you must set
all formatting for the selected data markers after using either command.For more information about Formatting Data Markers, choose the Search button in Help and type:
chart data markers
Additional query words:
Keywords :
Version : 5.00
Platform : WINDOWS
Issue type :
Technology :
|
Last Reviewed: September 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |