Extract data from an existing Line Chart, from one workbook to the Chart workbook

Corried

Board Regular
Joined
Dec 19, 2019
Messages
217
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
How to automatically extract data from an existing CHART, from one workbook "Example: GDP_Annual_Growth_Rate_%.xlm" to the CHART workbook "Example: PMI.xlm". Using VBA in excel.

Now, the worksheets data in each workbook is name after a country.

Example Below:

How can VBA extract data from worksheet #8: "Australia" in GDP_Annual_Growth_Rate_%.xlm workbook. To worksheet #2: "Australia" in PMI.xlm workbook Chart.



Note:

  1. GDP_Annual_Growth_Rate_%.xlm workbook, have 185 worksheet. Each named after a country.and
  2. PMI.xlm workbook, have 51 worksheet. Each named after a country
Please view files below if you are willing to help me.

Thanks in advance

Cheer

PMI.xlsm

GDP_Annual_Growth_Rate_%.xlsm
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Which data do you want? Y values? X values too? Is there only one series, or several?

And where in the target sheet do you want the data to be placed?
 
Upvote 0
Thank you Mr. Jon Peltier for your reply.

  1. As you quote: "Which data do you want? ". I want each worksheet in GDP_Annual_Growth_Rate_%.xlsm workbook, to transfer into each worksheet CHART in PMI.xlsm workbook.
  2. Quote: "Y values? X values too?". Yes. I would like both of them...
  3. Quote: "Is there only one series, or several? ". I am not sure what do you mean. Please help me to understand better...
  4. Quote: " Where in the target sheet do you want the data to be placed?". In each worksheet, which carries the same name as the other worksheet in the other workbook.
I am not sure if this answers are helpful, if you are help and open in helping me out.

Thanks in advance, Peltier
 
Upvote 0
Terminology. In Excel, a chart is a graphical object that plots data visually. A bunch of cells in a range. A specially formatted range with a header row and sort/filter buttons is a Table.

I assume by chart, you mean a range.
 
Upvote 0
Do you have addresses for the source and target ranges, or is it not well defined?
 
Upvote 0
Do you have addresses for the source and target ranges, or is it not well defined?
Humm. Let me see if I understand your question. Now, I have the data and the ranges for each worksheet. The problem is, each worksheet ranges are different depending on the historical data.

I am not sure if I answer the question.

Thanks in advance
 
Upvote 0
Humm. Let me see if I understand your question. Now, I have the data and the ranges for each worksheet. The problem is, each worksheet ranges are different depending on the historical data.

I am not sure if I answer the question.

Thanks in advance

Well, we're not getting anywhere. If you just need the values, you can use something like this to get data from "xyz.xlsm" to "abc.xlsm":

VBA Code:
Workbooks("abc.xlsm").Worksheets("defg").Range("A5:L25").Value = Workbooks("zyx.xlsm").Worksheets("tuvw").Range("E10:P30").Value
 
Upvote 0
Workbooks("abc.xlsm").Worksheets("defg").Range("A5:L25").Value = Workbooks("zyx.xlsm").Worksheets("tuvw").Range("E10:P30").Value

So it songs like I have to do it manually to get the values. I am not sure if you have saw the spreadsheet. I just don,t know. However, if you are open, here are the links for viewing:

PMI.xlsm

GDP_Annual_Growth_Rate_%.xlsm

What you suggest I do from here?
 
Upvote 0
So it songs like I have to do it manually to get the values. I am not sure if you have saw the spreadsheet. I just don,t know. However, if you are open, here are the links for viewing:

PMI.xlsm

GDP_Annual_Growth_Rate_%.xlsm

What you suggest I do from here?
I really don't like downloading people's workbooks. Could you take screenshots, or maybe use the XL2BB add-in so you can paste your sheet into he forum.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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