Chart Macro

 

 

Sub ChartCDsMacro()

Dim ichart As Long
Dim ncharts As Long
Dim colstart As String
Dim colend As String
Dim chartmonths As String

ncharts = ActiveSheet.ChartObjects.Count

colstart = "='Rpt'!$K$"
colend = ":$W$"
chartmonths = "='Rpt'!$K$6:$W$6"

For ichart = 1 To ncharts

ActiveSheet.ChartObjects(ichart).Activate
ActiveChart.Axes(xlValue).CrossesAt = -20
ActiveChart.ChartTitle.Text = "FHLB, LIBOR, and Treasury Spread"

ActiveChart.SeriesCollection(1).Values = colstart & (196 + ichart) & colend & (196 + ichart)
ActiveChart.SeriesCollection(1).Name = "=""FHLB"""
ActiveChart.SeriesCollection(1).Border.Color = RGB(0, 205, 0)
ActiveChart.SeriesCollection(1).Format.Line.DashStyle = msoLineDashDot
ActiveChart.SeriesCollection(1).XValues = chartmonths
ActiveChart.SeriesCollection(2).Values = colstart & (215 + ichart) & colend & (215 + ichart)
ActiveChart.SeriesCollection(2).Name = "=""LIBOR"""
ActiveChart.SeriesCollection(2).Format.Line.DashStyle = msoLineDash
ActiveChart.SeriesCollection(2).XValues = chartmonths
ActiveChart.SeriesCollection(3).Values = colstart & (234 + ichart) & colend & (234 + ichart)
ActiveChart.SeriesCollection(3).Name = "=""Treasury"""
ActiveChart.SeriesCollection(3).Format.Line.DashStyle = msoLineDashDotDot
ActiveChart.SeriesCollection(3).XValues = chartmonths
ActiveChart.SeriesCollection(4).Values = colstart & (177 + ichart) & colend & (177 + ichart)
ActiveChart.SeriesCollection(4).Name = "='Rpt'!$A$" & (177 + ichart)
ActiveChart.SeriesCollection(4).Format.Line.DashStyle = msoLineSolid
ActiveChart.SeriesCollection(4).XValues = chartmonths

ActiveChart.PlotArea.Select
Selection.InsideLeft = 48.381
Selection.InsideWidth = 267.118
Selection.InsideHeight = 201.359

ActiveChart.Legend.Select
Selection.Left = 79.164
Selection.Width = 190
Selection.Top = 245.451

Next

End Sub


Back to Macros

Back to Resume

Back to About Me