Sub Macro1()
For Each c In Range([a8], [a8].End(4))
If c >= [b2] And x = 0 Then x = c.Row
If c >= [b3] And y = 0 Then y = c.Row
Next
ActiveSheet.ChartObjects(1).Select
' Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("線圖").Range("A" & x & ":B" & y), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="線圖"
ActiveChart.HasDataTable = False
End Sub作者: vackbin 時間: 2011-3-7 00:42