Sub Macro2() Dim iRow, iCount iRow = 981 //从981行开始扩展 copy981行前的格式 Dim SampleChart Set SampleChart = Sheet1.ChartObjects("Chart 353") SampleChart.Copy For iCount = 1 To 100 'Sheet1.ChartObjects("Chart 353").Activate 'ActiveChart.ChartArea.Select 'ActiveChart.ChartArea.Copy 'Range("E" & iRow).Select 'ActiveSheet.Paste 'ActiveChart.FullSeriesCollection(2).Values = "=Detail!$F$" & iRow 'ActiveChart.FullSeriesCollection(1).Values = "Detail!$F$" & iRow + 1 Range("H" & iRow).Select //H 列的格式数据来源于I行 ActiveSheet.Paste ActiveChart.FullSeriesCollection(2).Values = "=Detail!$I$" & iRow ActiveChart.FullSeriesCollection(1).Values = "Detail!$I$" & iRow + 1 Range("L" & iRow).Select ActiveSheet.Paste ActiveChart.FullSeriesCollection(2).Values = "=Detail!$M$" & iRow ActiveChart.FullSeriesCollection(1).Values = "Detail!$M$" & iRow + 1 Range("O" & iRow).Select ActiveSheet.Paste ActiveChart.FullSeriesCollection(2).Values = "=Detail!$P$" & iRow ActiveChart.FullSeriesCollection(1).Values = "Detail!$P$" & iRow + 1 iRow = iRow + 3 Next End Sub
可以供Excel的格式扩充使用,用于开发和调整导出的模板