F
ferrdav
Good Morning,
i get this problem: i have a worksheet like this:
A B C D
1 10/03 2 10/03 45
2 11/03 6 11/03 85
3 12/03 8 12/03 96
4 13/03 3 13/03 52
what i would like to do is a macro that make a graph taking columns A&B
and then a second grafh taking columns C&D and so on...
i wrote this, but it does not work (in my spreadsheet i get 146 columns
and 256 rows...):
For i = 1 To 146
Range(.Cells(i, 2), .Cells(i + 1, 256)).Select
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlAreaStacked
ActiveChart.SetSourceData
Source:=Sheets("INDUSTRIALS").Range(.Cells(i, 2), .Cells(i + 1, 256)),
_
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="INDUSTRIALS"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "Asset Swap Spread Bid"
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.Legend.Select
Selection.Delete
Next i
End Sub
any help? thank you!
i get this problem: i have a worksheet like this:
A B C D
1 10/03 2 10/03 45
2 11/03 6 11/03 85
3 12/03 8 12/03 96
4 13/03 3 13/03 52
what i would like to do is a macro that make a graph taking columns A&B
and then a second grafh taking columns C&D and so on...
i wrote this, but it does not work (in my spreadsheet i get 146 columns
and 256 rows...):
For i = 1 To 146
Range(.Cells(i, 2), .Cells(i + 1, 256)).Select
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlAreaStacked
ActiveChart.SetSourceData
Source:=Sheets("INDUSTRIALS").Range(.Cells(i, 2), .Cells(i + 1, 256)),
_
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="INDUSTRIALS"
With ActiveChart
HasTitle = True
ChartTitle.Characters.Text = "Asset Swap Spread Bid"
Axes(xlCategory, xlPrimary).HasTitle = False
Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.Legend.Select
Selection.Delete
Next i
End Sub
any help? thank you!