Office JS Excel Chart Format

Sachin Deshmukh 0 Reputation points
2023-05-10T13:45:11.71+00:00

To get chart, series, series point formatting, I have to load each format property (e.g axisGroup, gradient color etc).Is there any way we get chart, series and series point formatting is single function?

Microsoft 365 and Office Development Other
Microsoft 365 and Office Excel For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tanay Prasad 2,250 Reputation points
    2023-05-11T06:10:23.2866667+00:00

    Hi,

    Yes, there is a way to get the formatting for charts, series, and series point in a single function in Excel VBA. You can use the "With" statement to apply multiple formatting properties to a chart or series at once. For example:

    With ActiveChart.SeriesCollection(1)
        .MarkerStyle = xlMarkerStyleCircle
        .MarkerSize = 8
        .Format.Fill.ForeColor.RGB = RGB(255, 0, 0)
    End With
    
    

    In this example, I have formatted the first series in the active chart by changing the marker style, marker size, and fill color all in one "With" statement.

    Best Regards.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.