代码改变世界

vba 设置坐标轴

2016-07-11 18:42  sylar_liang  阅读(2402)  评论(0编辑  收藏  举报

1.辅助线虚线

ActiveSheet.ChartObjects("图表1").Activate

ActiveChart.Axes(xlValue).Select

ActiveChart.Axes(xlValue).MajorGridlines.Select

With Selection.Format.Line

  .Visible = msoTrue

  .DashStyle = msoLineDash

End With

 

2.x轴坐标向右

ActiveChart.ChartArea.Select

ActiveChart.Axes(xlCategory).Select

Seletion.MajorTickMark = xlInside

 

3.Y轴坐标向上

Selection.MajortickMark = xlInside