I have a calls capacity excel macro that generates a report depending on a shift. The report is a chart that is generated via the following code:
What I need to find out is how can I set the Series (S1, s2... etc) legend to be displayed at the BOTTOM of the graph instead of at the right of the graph (where it is located by default) in VBA.
Code:
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range(Cells(2, 1), Cells(6, crumbles))
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Legend.Select
ActiveChart.SeriesCollection(1).Name = "S1"
ActiveChart.SeriesCollection(2).Name = "S2"
ActiveChart.SeriesCollection(3).Name = "S3"
ActiveChart.SeriesCollection(4).Name = "S4"
ActiveChart.SeriesCollection(5).Name = "S5"
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).ApplyDataLabels
ActiveChart.SeriesCollection(3).DataLabels.Select
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).ApplyDataLabels
ActiveChart.SeriesCollection(2).DataLabels.Select
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(4).Select
ActiveChart.SeriesCollection(4).ApplyDataLabels
ActiveChart.SeriesCollection(4).DataLabels.Select
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(5).Select
ActiveChart.SeriesCollection(5).ApplyDataLabels
ActiveChart.SeriesCollection(5).DataLabels.Select
Selection.Position = xlLabelPositionAbove
ActiveChart.SeriesCollection(1).XValues = Range(Cells(1, 1), Cells(1, crumbles))
ActiveChart.Axes(xlCategory).HasMajorGridlines = True
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:=ShiftName + "_excel"
ActiveWorkbook.PublishObjects.Add(xlSourceChart, "D:\www\scheduler\" & ShiftName & ".htm", ShiftName + "_excel", "", xlHtmlStatic, _
ShiftName & "W4P_ID", ShiftName & " Calls Capacity" _
& " (last refresh at: " & Now() & ")").Publish (True)
What I need to find out is how can I set the Series (S1, s2... etc) legend to be displayed at the BOTTOM of the graph instead of at the right of the graph (where it is located by default) in VBA.