在vba中设置散点图中x轴的间隔

我试图设置X轴的interals

2016/02/01 2016/02/15 2016/03/01 2016/03/15 2016/04/01 2016/04/15 

即。 2周间隔为x轴。 但是我写的代码没有正确设置。 当我运行我得到的代码

2016年2月1日
2016年3月22日
2016年5月11日

  ActiveSheet.Shapes.AddChart.Select ActiveChart.ChartType = xlXYScatterLines ActiveChart.SetSourceData Source:=Range("UserLog!$AC$1:$AD$" & date_no_row) ActiveChart.Axes(xlCategory).MinimumScale = 42401 ActiveChart.Axes(xlCategory).MaximumScale = 42491 Const iIntervals As Integer = 15 With ActiveChart.Axes(xlCategory) .MajorUnit = (.MaximumScale - .MinimumScale) / iIntervals End With 

如何将间隔设置为2周?

得到它了。 以下代码将间隔设置为2周

 ActiveChart.Axes(xlCategory).Select With ActiveChart.Axes(xlCategory) .MinimumScale = "2016/02/01" .MaximumScale = "2016/05/15" .BaseUnitIsAuto = True .MajorUnit = 7 .MajorUnitScale = xlDays .MinorUnitIsAuto = True .Crosses = xlAutomatic .AxisBetweenCategories = True .ReversePlotOrder = False End With End Sub