How to assign XValues for excel chart using VBA

前端 未结 2 619
鱼传尺愫
鱼传尺愫 2020-12-22 00:49

I have this VBA function for drawing charts in Excel 2013:

Sub DrawChart2(obj_worksheetTgt As Worksheet, ByVal XLabels As Range, ByVal DataValues As Range, B         


        
2条回答
  •  情话喂你
    2020-12-22 00:52

    You cannot use named ranges for .XValues or .Values, but you can change the .Formula property by replacing the series formula

    For more information on editing the series formula see http://peltiertech.com/change-series-formula-improved-routines/

    Note of caution, there is a bug in Excel 2013 that prevents you from using named ranges starting with "R" or "C" when using VBA to change the series formula; see http://answers.microsoft.com/en-us/office/forum/office_2013_release-excel/named-range-use-in-chart-series-formulas-causes/c5a40317-c33f-4a83-84db-0eeee5c8827f/?auth=1&rtAction=1466703182593

提交回复
热议问题