LoginSignup
0
1

More than 3 years have passed since last update.

VBAでグラフの軸を1時間単位に設定

Posted at

VBA グラフの軸を1時間単位に設定


Option Explicit

Sub set_x_axes()
    ActiveChart.Axes(xlCategory).Select

    ' 補助目盛りの幅を1分単位に設定
    ActiveChart.Axes(xlCategory).MinorUnit = 1 / 24 / 60

    ' 目盛りの幅を1時間単位に設定
    ActiveChart.Axes(xlCategory).MajorUnit = 1 / 24

  ' 横軸の最小値
'    ActiveChart.Axes(xlCategory).MinimumScale = 43737.0000115749
  ' 横軸の最大値
'    ActiveChart.Axes(xlCategory).MaximumScale = 43737.0416782438

    ' 目盛りラベルの角度を変更
    Selection.TickLabels.Orientation = 70

    ActiveChart.PlotArea.Select

End Sub
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1