VBA for graph upgrade in other sheet

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"
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top