I have a macro to create a chart dynamically and i want to be able to add a footer or text to the bottom of the chart if possible, i would like to know what the property is to do this, my code is below:
Sub CreateChart()
' Select the cell in the upper-left corner of the chart.
Range("Data").Select
mysheetname = ActiveSheet.Name
' Add a chart to the active sheet.
ActiveSheet.ChartObjects.Add(550.122, 100, 400.5, 155.25).Select
Application.CutCopyMode = False
ActiveChart.ChartWizard _
Source:=Sheets(mysheetname).Range("Data"), _
Gallery:=xlColumn, Format:=1, PlotBy:=xlColumns, _
CategoryLabels:=2, SeriesLabels:=1, HasLegend:=0, _
Title:=Sheets(mysheetname).Range("ChartName").Value, CategoryTitle:="", _
ValueTitle:="", ExtraTitle:=""
'Chart Border
With ActiveChart.ChartArea
.Border.LineStyle = xlMedium
End With
'Chart Title
With ActiveChart.ChartTitle
.Font.Size = 8
End With
'Chart Width/Height
ActiveChart.Parent.Width = 906
ActiveChart.Parent.Height = 450
'Series 1
ActiveChart.SeriesCollection(1).Interior.ColorIndex = 50 'Series Column Green
ActiveChart.ChartGroups(1).Overlap = 100
With Selection
End With
'Series 2
ActiveChart.SeriesCollection(2).Interior.ColorIndex = 3 'Series Column Red
With Selection
'.Border.Weight = xlMedium
'.Border.ColorIndex = 1 'White Border
End With
'Format Y Axis
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MinorUnit = 10
.MajorUnit = 10
.MaximumScale = 100
.TickLabels.Font.Size = 8
End With
'Format X Axis
With ActiveChart.Axes(xlCategory)
.TickLabels.Font.Size = 8
End With
End Sub
Bookmarks