[Excel] [VBA]如何在图表中绘制线条?

请查看此图片以获得我的明确问题:
Sub Tester()
    Dim s, d

    d = #4/18/2011# * 1 ''a bit of a hack, since I could figure out how to plot a date directly
    With ActiveSheet.ChartObjects("Chart 1").Chart 'adjust to suit

        Set s = .SeriesCollection.NewSeries()
        With s
            .Name = ""
            .XValues = Array(d, d)
            .Values = Array(90, 0)
            .MarkerStyle = xlMarkerStyleNone
            .Border.Color = vbRed
        End With

    End With

End Sub
相关文章
相关标签/搜索