Vba update chart series




















Refresh '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Sheets "PCC". ChartObjects "Chart 21". ChartObjects "Chart 22". ChartObjects "Chart 24". ChartObjects "Chart 26". Refresh '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Sheets "TCP".

ChartObjects "Chart 30". ChartObjects "Chart 31". ChartObjects "Chart 34". ChartObjects "Chart 35". ChartObjects "Chart 36". ChartObjects "Chart 38". Refresh '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Sheets "PST".

ChartObjects "Chart 23". ChartObjects "Chart 25". Refresh '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''' Sheets "MPA". Chihiro Excel Ninja. This should do the trick. SeriesCollection n. Improve this question. Community Bot 1 1 1 silver badge. Danny Yun Danny Yun 11 1 1 silver badge 3 3 bronze badges. Count — A. Danny Yun try the code in my answer below — Shai Rado.

Thank you for your comment. I've got rid of Activating chart. I do have code to disable and enable screen updating code between the codes below. I just didn't add that here. As your recommendation, I've used 'Step In' with the debugger. I am not sure why it does work sometimes and doesn't work. And thanks for the tip on '. Anyway, the issue persists. Add a comment. Active Oldest Votes. Range "G37". SeriesCollection Ser. Count Ser. Improve this answer. Shai Rado Shai Rado Thank you.

The value data, highlighted in blue, are plotted in rows, parallel to the category labels. No cells are highlighted to indicate series names. The formula for the first series is shown below the chart. The reference for the series name should be between the open parenthesis and the first comma. For this series, we can extract the arguments from the formula.

We will determine the range for the Y values, find the cell right before this range, and insert its reference into the series formula where we now have a blank.

Good thinking, eh? Burn me twice, shame on me. Here is the procedure that does all the work. We pass in the series, and it fixes the series formula. The steps taken by the code are:. Here is our first chart above after running the code. The highlighted ranges include the green outlined range with series names, and the names are also shown in the legend.

The series formula shown below the chart now has a reference to the cell with the series name. The series names are highlighted in the worksheet and appear in the legend, and the series formula has been updated with a reference to the cell with the label. The highlighting of the ranges in the worksheet is more pronounced.

The outline for the values are still blue, but the line is thicker, and the range is filled in with a light shade of blue. The outline for the category labels is still purple, but again, the line is thicker and the cells are lightly filled. The series name outline has switched from green to thicker red, and the cells are lightly shaded in I like this more obvious shading in The thin outlines were not obvious enough until I already knew what I was looking for.



0コメント

  • 1000 / 1000