excel如何做VBA自动折线图,类似下边这类,但要图片一这种分开的图,或者2条线一组的。请高手指点,

下边横排数据是我找的,有代码和图,我想要自动的单排图,就是每条线都分开的图。'Option ExplicitSub 设置数据标志大小()Dim o, pWith Sheets("sheet1").Shapes.AddChart(xlLineMarkers, 0, 0, 600, 300).Chart '在(0,0)坐标处插入折线图 .SetSourceData Source:=Range("Sheet1!$B$2:$n$5") '设置数据源 .SetElement msoElementLegendNone '不显示图例项 .SeriesCollection(1).MarkerStyle = 0 e = 7 p = 10 .SeriesCollection(1).Points(e).MarkerStyle = 8 '0时不显示数据标志,8显示数据标志 .SeriesCollection(1).Points(e).MarkerSize = p '设置数据标志大小 .SeriesCollection(1).Points(e).Format.Fill.ForeColor.RGB = RGB(255, 0, 0) o = 19 .SeriesCollection(1).Points(e).MarkerStyle = 8 '0时不显示数据标志,8显示数据标志 .SeriesCollection(1).Points(e).MarkerSize = p '设置数据标志大小 .SeriesCollection(1).Points(e).Format.Fill.ForeColor.RGB = RGB(255, 0, 0)End WithEnd SubPrivate Sub CommandButton1_Click()Call 设置数据标志大小End Sub这是数据张三 20 100 75 93 56 74 99 21 77 4 56 54 60王五 5 4 2 3 6 9 8 5 2 3 54 4 55赵六 65 72 34 56 87 91 99 87 76 55 32 45 86李奇 56 2 65 2 2 5 45 3 9 6 5 8 5
请看后面详细的

第1个回答  2017-01-08
机务段刳笆幻灯肝蔷本回答被提问者采纳
相似回答