How to Change Excel Scatter Chart Markers Based on Data Ranges in WPS Office
Question details
The user needs to format Excel scatter chart data points with different marker shapes and colors based on X-value ranges, including red circles, yellow squares, and additional conditional ranges.

- Product
- WPS Office Spreadsheets (Excel-compatible)
- Device & OS
- not provided
- Scenario
- A user has an Excel scatter chart and wants marker formatting to change automatically according to X-value thresholds instead of manually formatting each point.
- Observed behavior
- The scatter chart currently uses one marker style; the user wants marker shape and color to reflect X-value ranges automatically.
Before you begin, open the workbook in WPS Office Spreadsheets and confirm that macros are enabled for the file. Select the scatter chart and note the exact X-axis thresholds, marker shapes, and marker colors you want to apply.
Run a VBA Macro to Apply Marker Styles by X-Value Range in WPS Office Spreadsheets
Use this method when you need automatic, repeatable marker formatting for a scatter chart with many points and the chart does not apply marker styles by data range.
The VBA macro reads the selected scatter chart series, loops through each point, compares the point’s X value against your thresholds, and applies the matching marker shape and color with a Select Case block. Common settings are xlMarkerStyleCircle and xlMarkerStyleSquare for shapes, and RGB(255,0,0) for red or RGB(255,255,0) for yellow for marker colors.
In WPS Office Spreadsheets, press Alt+F11 or click Tools > Macro > Visual Basic Editor to open the VBA editor window.
In the VBA editor, click Insert > Module. In the new module, create a macro that reads each point’s X value and uses Select Case to assign xlMarkerStyleCircle or xlMarkerStyleSquare and red or yellow marker colors for the required ranges.
Edit the Select Case conditions to match your X-value thresholds. Set Point.MarkerStyle = xlMarkerStyleCircle for circles, Point.MarkerStyle = xlMarkerStyleSquare for squares, and Point.MarkerForegroundColor = RGB(255,0,0) or RGB(255,255,0) for red and yellow.
Close the VBA editor, click your scatter chart to select it, press Alt+F8 or go to Tools > Macro > Macros, select the macro name from the list, and click Run.
Save the workbook in a macro-enabled format such as Excel Macro-Enabled Workbook (.xlsm) so the formatting macro remains available for future changes.

Apply Conditional Scatter Chart Markers in WPS Office Spreadsheets
Use the built-in VBA editor in WPS Office Spreadsheets to run a marker-formatting macro for Excel-compatible scatter charts. The macro reads each point’s X value and assigns red circles, yellow squares, or other styles by threshold.
- 1. Enable macros if prompted: Open the workbook in WPS Office Spreadsheets and choose Enable Content if a macro security warning appears, so the formatting macro can run.
- 2. Open the Visual Basic Editor: Press Alt+F11 or click Tools > Macro > Visual Basic Editor to open the VBA editor.
- 3. Insert and edit the marker macro: Click Insert > Module, paste or write the Select Case macro, and set MarkerStyle to xlMarkerStyleCircle or xlMarkerStyleSquare and MarkerForegroundColor to RGB(255,0,0) or RGB(255,255,0) for the required X-value thresholds.
- 4. Run the macro on the scatter chart: Select the scatter chart, press Alt+F8 or go to Tools > Macro > Macros, choose the macro, and click Run.
- 5. Save the macro-enabled workbook: Save the file as a macro-enabled workbook (.xlsm) so the marker formatting macro is retained.

Frequently Asked Questions
Why do my scatter chart markers not change after I run the macro?
Make sure you selected the chart before running the macro. The macro works on the active chart, so click the scatter chart, then run the macro from Tools > Macro > Macros or by pressing Alt+F8.
Can I add more than red circles and yellow squares in the same macro?
Yes. Add more Case blocks in the Select Case statement and set MarkerStyle and MarkerForegroundColor for each X-value range. Use xlMarkerStyleCircle, xlMarkerStyleSquare, xlMarkerStyleDiamond, or other supported marker styles.
Does WPS Office support VBA macros for Excel chart formatting?
WPS Office Spreadsheets includes a VBA editor and supports many Excel-compatible chart and macro objects, so you can run the marker-formatting macro in .xlsm workbooks.
How do I save the workbook so the marker macro is not lost?
Save the file in the macro-enabled .xlsm format. Use File > Save As and choose Excel Macro-Enabled Workbook (.xlsm) before closing.
What should I do if the marker colors look different after running the macro?
Check the RGB values in your code. Red is RGB(255,0,0) and yellow is RGB(255,255,0). Adjust these values if your workbook uses a different color scheme.




