slashiiboy
06-09-2017, 09:41 PM
Hi everybody, I am trying to customize my "x" axis in a chart, this axis contains years and "y" axis contains the number of events. So what I am trying to do is to start my "x" axis in the year 1904, then the next year should be 1910, 1920, 1930.....2013. I must use this specific interval, it must start in 1904, the next value 1910 adding 10 years at a time till 2013 exactly. I've been trying with this VBA code:
Sub ScaleAxes()
With Application.ActiveChart.Axes(xlCategory, xlPrimary)
.MinimumScale = ActiveSheet.Range("t3").Value
.MaximumScale = ActiveSheet.Range("t15").Value
.MajorUnit = ActiveSheet.Range("t17").Value
.DisplayUnit = ActiveSheet.Range("t15").Value
End With
End Sub
But this only helps me to set the minimun and maximum I am still trying to figure how to start the sum in 1910.... The final scale should look like this:
1904,1910, 1920.....2013
THANKS IN ADVANCE
Sub ScaleAxes()
With Application.ActiveChart.Axes(xlCategory, xlPrimary)
.MinimumScale = ActiveSheet.Range("t3").Value
.MaximumScale = ActiveSheet.Range("t15").Value
.MajorUnit = ActiveSheet.Range("t17").Value
.DisplayUnit = ActiveSheet.Range("t15").Value
End With
End Sub
But this only helps me to set the minimun and maximum I am still trying to figure how to start the sum in 1910.... The final scale should look like this:
1904,1910, 1920.....2013
THANKS IN ADVANCE