excel_guy123
New Member
- Joined
- Oct 26, 2010
- Messages
- 3
Hi guys,
Am hoping someone here can help me... I have a worksheet, from which I have created a number of charts that sit in another worksheet.
At the moment the data sitting in the data worksheet is Feb to September, but next month it needs to be Feb to October.
At the moment, I have a chart that pulls data range:
And then the macro needs to automatically offset the data (0, 1) - i.e. CHARTDATA needs to be $C$1:$L$13, then $C$1:$M$13.
The offset needs to happen every time I run the macro.. I've been toying with a couple of bits of code, to no avail - hoping someone can advise... this is what I have so far:
If anyone has any suggestions I would be most grateful...
Am hoping someone here can help me... I have a worksheet, from which I have created a number of charts that sit in another worksheet.
At the moment the data sitting in the data worksheet is Feb to September, but next month it needs to be Feb to October.
At the moment, I have a chart that pulls data range:
Code:
=Master!$C$1:$K$13
And then the macro needs to automatically offset the data (0, 1) - i.e. CHARTDATA needs to be $C$1:$L$13, then $C$1:$M$13.
The offset needs to happen every time I run the macro.. I've been toying with a couple of bits of code, to no avail - hoping someone can advise... this is what I have so far:
Code:
Sub Macro2()
Sheets("Charts").Select
ActiveSheet.ChartObjects("Chart 1").Activate
Set ChartData = Range(Range("D2").Offset(0, 1).End(xlToRight))
ActiveSheet.ChartObjects("Chart 1").Chart.SetSourceData Source:=ChartData
End Sub
If anyone has any suggestions I would be most grateful...