Muhammad Ahmad Zia
New Member
- Joined
- Jun 14, 2015
- Messages
- 1
Hello everyone,
kindly help,
i have two sheets in a workbook, in one i have data which updates on daily basis and a new row adds
and in other sheet i have graph which needs to update for last 30 days(1st case) / just the new added row (2nd ) case.
below mention code can do it if the graph is within the same sheet, but i need if it has to pick the data from other sheet.
Sheets("SCG Monthly Trend").Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.PlotArea.Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.SetSourceData Source:=ActiveCell.Offset(-30, 0).Range( _
"A1:C30")
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.PlotArea.Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.SeriesCollection(1).Name = "='SCG Monthly Trend'!$B$1"
ActiveChart.SeriesCollection(2).Name = "='SCG Monthly Trend'!$C$1"
kindly help,
i have two sheets in a workbook, in one i have data which updates on daily basis and a new row adds
and in other sheet i have graph which needs to update for last 30 days(1st case) / just the new added row (2nd ) case.
below mention code can do it if the graph is within the same sheet, but i need if it has to pick the data from other sheet.
Sheets("SCG Monthly Trend").Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.PlotArea.Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.SetSourceData Source:=ActiveCell.Offset(-30, 0).Range( _
"A1:C30")
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.PlotArea.Select
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.SeriesCollection(1).Name = "='SCG Monthly Trend'!$B$1"
ActiveChart.SeriesCollection(2).Name = "='SCG Monthly Trend'!$C$1"