Changing Bar colors using VBA based on category label

前端 未结 2 1836
夕颜
夕颜 2020-12-22 10:28

I have a VBA code in excel to change colors of bar graph but its not working for category series.

ActiveChart.SeriesCollection(1).Interior.Color = RGB(0, 15         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 11:34

    Your problem isn't with the VBA, to have different colored bars they must be on different series.

    Leave a gap in the base colored series and add the values you want colored on a second series and color that. Your data would look something like this:

    Series | Month 1 | Month 2 | Month 3 | Month 4 | Month 5 | Month 6 | Month 7
      1         10        12       15                   14                  10
      2                                       17
      3                                                           18
    

提交回复
热议问题