I have a chart labeled "Time Spent versus time allocated" and it has a code that will update the chart when new data is entered.
However from looking at the bar chart you can see that the formatting of the bars and the labels are not quite right.
Any idea of how i can set the formatting through VBA?
Below is the code being used:
However from looking at the bar chart you can see that the formatting of the bars and the labels are not quite right.
Any idea of how i can set the formatting through VBA?
Below is the code being used:
VBA Code:
Private Sub TimeSpent()
Dim ch As ChartObject
Set ch = Worksheets("Executive Summary").ChartObjects("Chart 8")
LastRow = Worksheets("Executive Summary").Columns("J").Find(1, SearchDirection:=xlPrevious, LookIn:=xlValues, LookAt:=xlWhole).Row
Worksheets("Executive Summary").ChartObjects("Chart 8").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(1).Name = Worksheets("Executive Summary").Range("L34")
ActiveChart.FullSeriesCollection(1).Values = Range(Cells(35, 12), Cells(LastRow, 12))
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(2).Name = Worksheets("Executive Summary").Range("M34")
ActiveChart.FullSeriesCollection(2).Values = Range(Cells(35, 13), Cells(LastRow, 13))
ActiveChart.HasLegend = True
End Sub