在迷你图上设置自定义轴值

时间:2017-01-04 20:23:47

标签: excel vba excel-vba

我正在尝试在我的迷你图中设置自定义值,但是,我不断获得Run-time error: Object doesn't support this property or method。我的.Custom值部分中哪里出错?

    With spark
        .Points.Markers.Visible = True
        .Points.Markers.Color.Color = vbBlack
        .CustomMinScaleValue = -0.1 'error thrown here
        .CustomMaxScaleValue = 1.2 'error will most likely be thrown here
    End With

1 个答案:

答案 0 :(得分:1)

  

CustomMinScaleValue属性只能在。时返回或设置   设置指定的SparkVerticalAxis对象的MinScaleType属性   到xlSparkScaleCustom(3)。

https://msdn.microsoft.com/en-us/library/office/ff194837.aspx

CustomMaxScaleValue

的类似问题

未测试:

With spark

    .Points.Markers.Visible = True
    .Points.Markers.Color.Color = vbBlack

    .Axes.Vertical.MinScaleType = xlSparkScaleCustom '<<<
    .CustomMinScaleValue = -0.1 

    .Axes.Vertical.MaxScaleType = xlSparkScaleCustom '<<<
    .CustomMaxScaleValue = 1.2 

End With