|
- Sub xxx()
- ActiveSheet.ChartObjects(2).Activate
- k = 7
- s = 1
- lane = 24
- For i = 1 To 10
- 'For k = 0 To 10
- 'If Not IsNumeric(Sheets(s).Cells(lane + i - 1, k + 3)) Then Exit For
- ' Next k
- ActiveChart.SeriesCollection.NewSeries
- ActiveChart.SeriesCollection(i).Name = Sheets(s).Cells(lane + i - 1, 2)
- ActiveChart.SeriesCollection(i).XValues = Sheets(s).Cells(3, 3).Resize(1, k)
- ActiveChart.SeriesCollection(i).Values = Sheets(s).Cells(lane + i - 1, 3).Resize(1, k)
- Next i
- ActiveChart.Axes(xlCategory).Select
- Selection.TickLabels.NumberFormatLocal = "G/通用格式""天"""
- ActiveChart.SetElement (msoElementChartTitleCenteredOverlay)
- ActiveChart.ChartTitle.Select
- ActiveChart.ChartTitle.Text = "sdfd" & Sheets(s).Cells(lane, 1) & "sdfds"
- End Sub
复制代码 用上面的VBA作出的图,第二个不同于第一个,应当是默认的座标不一样,如何把第二个的做成类似于第一个的?
截图及含代码的EXCEL见附件,请高人帮助。
[ 本帖最后由 chenzyyysl 于 2011-7-9 16:54 编辑 ] |
|