VBA chart Question

dualhcsniatpac

Board Regular
Joined
Feb 18, 2009
Messages
126
I have 1 file that will be all charts.

Another file is all data.

Do I have to OPEN the data file to populate the charts with the data that is in there??

Or will it just update??

Code:
ActiveSheet.Shapes.AddChart.Select
    ActiveChart.ChartType = xlXYScatterLines
    
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(1).Name = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$B$1"
    ActiveChart.SeriesCollection(1).XValues = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$B$2:$B$4"
    ActiveChart.SeriesCollection(1).XValues = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$A$2:$A$4"
    ActiveChart.SeriesCollection(1).Values = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$B$2:$B$4"
    
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(2).Name = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$C$1"
    ActiveChart.SeriesCollection(2).XValues = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$A$2:$A$4"
    ActiveChart.SeriesCollection(2).Values = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$C$2:$C$4"
    
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(3).Name = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$D$1"
    ActiveChart.SeriesCollection(3).XValues = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$A$2:$A$4"
    ActiveChart.SeriesCollection(3).Values = "='[High Volume Scrap 2009.xls]Volume and Buy Back 2009'!$D$2:$D$4"

Can I do the above? I know I can but will it work without opening the High Volume Scrap 2009 file???

Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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