我是 VBA 的新手,我正在制作一个需要两个 y 轴并共享相同 x 轴的图表。我不太确定 xlvalue 和 xlcategory 的整个概念以及如何使用它们,我在网上使用了一些示例,但无法使其工作。我在下面粘贴了我的代码。提前致谢 !!
With Totalchart.Axes(xlCategory)
.HasTitle = True
.HasTitle = True
.HasMajorGridlines = True
.HasMinorGridlines = True
With .AxisTitle
.Caption = "Time (min)"
.Font.Name = "bookman"
.Font.Size = 10
End With
End With
With Totalchart.Axes(xlValue)
'.CategoryType = xlAutomatic
.HasTitle = True
.HasTitle = True
.HasMajorGridlines = True
.HasMinorGridlines = True
.MinimumScale = 0
With .AxisTitle
.Caption = "caption1"
.Font.Name = "bookman"
.Font.Size = 10
End With
End With
With Totalchart.Axes(xlValue, xlSecondary)
'.CategoryType = xlAutomatic
.HasTitle = True
.HasTitle = True
.MinimumScale = 0
With .AxisTitle
.Caption = "Caption2"
.Font.Name = "bookman"
.Font.Size = 10
End With
End With