码迷,mamicode.com
首页 > 编程语言 > 详细

Excel VBA Chart 刻度 Axis.DisplayUnit

时间:2020-06-07 21:45:16      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:stack   tle   span   ndt   res   red   run   tac   scale   

 

With Sheets("Report").ChartObjects.Add(...)
    .Chart.Axes(xlCategory).MinimumScale = RoundTo50(Sheets(sheetName).Range("M4"))
    .Chart.Axes(xlCategory).MaximumScale = RoundTo50(Sheets(sheetName).Range("M124"))
    .Chart.Axes(xlCategory).MajorUnit = RoundTo50((.Chart.Axes(xlCategory).MaximumScale - .Chart.Axes(xlCategory).MinimumScale) / 12)
    .Chart.Axes(xlCategory).MinorUnit = .Chart.Axes(xlCategory).MajorUnit / 3

 

With Charts("Chart1").Axes(xlValue)
 .DisplayUnit = xlHundreds
 .HasTitle = True
 .AxisTitle.Caption = "Rebate Amounts"
End With

 

REF:

https://stackoverflow.com/questions/10110594/how-to-round-off-x-ticklabels-to-the-nearest-50

 

Excel VBA Chart 刻度 Axis.DisplayUnit

标签:stack   tle   span   ndt   res   red   run   tac   scale   

原文地址:https://www.cnblogs.com/emanlee/p/13061963.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!