Fix VBA Marker Colors in an Excel Scatter Chart
Question details
The user needs to keep scatter chart marker colors consistent when an Excel VBA macro changes chart formatting.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A VBA macro creates or modifies an Excel scatter chart and formats its data series.
- Observed behavior
- Marker colors can change when the macro reapplies series formatting or uses theme colors.
Open the workbook in desktop Excel and identify the chart name and series you want to format. Make sure the workbook is saved as a macro-enabled .xlsm file if it contains VBA code.
Set fixed RGB marker colors after formatting the chart
Use this approach to prevent theme or chart style changes from determining the final marker colors.
In desktop Excel, open the Developer tab and select Visual Basic. Open the module containing the macro that creates or modifies the chart.
After the chart creation and formatting code, add lines such as: With ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1) .MarkerStyle = xlMarkerStyleCircle .MarkerBackgroundColor = RGB(255, 0, 0) .MarkerForegroundColor = RGB(255, 0, 0) End With Replace "Chart 1" with your chart name, adjust the series index, and choose your RGB values.
Repeat the With block for each SeriesCollection index that needs a fixed color. Set both MarkerBackgroundColor and MarkerForegroundColor for each series.
Run the macro from Developer > Macros, then inspect the scatter chart. Keep the color assignments after any chart style or series formatting commands so those commands do not overwrite them.

Create and edit scatter charts with WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open Excel files and work with charts in WPS Spreadsheets for an easier transition, though it does not fix Excel VBA formatting behavior.

Frequently Asked Questions
Why do my scatter chart marker colors change after a macro runs?
The macro may reset the chart style or series formatting, or the series may use theme colors. Assign fixed RGB values after those formatting commands.
Which VBA properties control the marker fill and outline?
Use Series.MarkerBackgroundColor for the marker fill and Series.MarkerForegroundColor for its foreground or outline. Assign each property a value such as RGB(255, 0, 0).
How do I give each scatter chart series a different color?
In the VBA editor, address each series with Chart.SeriesCollection(index) and set its MarkerBackgroundColor and MarkerForegroundColor to the desired RGB values.
Can I run this VBA fix in Excel for the web?
Excel for the web does not run VBA macros. Open the workbook in desktop Excel, then use Developer > Visual Basic to edit the code and Developer > Macros to run it.




