Hi all,
So i have managed this before but can not get it today.
I have a named range Chart_Updater and this contains the details of the data rows for charts,
Chart_Updater = Worksheets("Sorts").Range("Chart_Updater")
For i = 1 To 1
x = thismonth
Set SourceSheet = Worksheets("Data")
XDatarow = 1
Set MyChartXData = SourceSheet.Range(Cells(XDatarow, thismonth), Cells(XDatarow, thismonth - 11))
'Define values for each chart
Select Case Chart_Updater(i, 5)
Case 1
seriesnum = Chart_Updater(i, 4) ' the amount of series for each chart
datarow = Chart_Updater(i, 2) ' the row on the data sheet the data for the chart can be found
Set DestSheet = Worksheets(Chart_Updater(i, 3))' the sheet the chart is on
End Select
Set MyChart = DestSheet.ChartObjects("Chart " & Chart_Updater(i, 1)) ' each cart is named Chart 104 ect this picks up the cart name.
For j = datarow To seriesnum + datarow
SourceSheet.Activate
Set MyChartData = SourceSheet.Range(Cells(datarow, x), Cells(datarow, x - 11))
MyChart.Activate
ActiveChart.SeriesCollection(j).Values = MyChartData
Next j
Next i
So this code does not seem to be gathering the data and updating. It might be that I have completely messed this up so any advise would be very welcome.
So i have managed this before but can not get it today.
I have a named range Chart_Updater and this contains the details of the data rows for charts,
Code:
For i = 1 To 1
x = thismonth
Set SourceSheet = Worksheets("Data")
XDatarow = 1
Set MyChartXData = SourceSheet.Range(Cells(XDatarow, thismonth), Cells(XDatarow, thismonth - 11))
'Define values for each chart
Select Case Chart_Updater(i, 5)
Case 1
seriesnum = Chart_Updater(i, 4) ' the amount of series for each chart
datarow = Chart_Updater(i, 2) ' the row on the data sheet the data for the chart can be found
Set DestSheet = Worksheets(Chart_Updater(i, 3))' the sheet the chart is on
End Select
Set MyChart = DestSheet.ChartObjects("Chart " & Chart_Updater(i, 1)) ' each cart is named Chart 104 ect this picks up the cart name.
For j = datarow To seriesnum + datarow
SourceSheet.Activate
Set MyChartData = SourceSheet.Range(Cells(datarow, x), Cells(datarow, x - 11))
MyChart.Activate
ActiveChart.SeriesCollection(j).Values = MyChartData
Next j
Next i
Code:
So this code does not seem to be gathering the data and updating. It might be that I have completely messed this up so any advise would be very welcome.