View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Grey Newt[_4_] Grey Newt[_4_] is offline
external usenet poster
 
Posts: 9
Default Chart source data when copying from one workbook to another

OK - so do i assume that you don't want to copy the entire sheet - just the
embedded graph and its respective data ?

"Drew Lettington" wrote:


Thanks for the reply. In my case, however, the chart and its source
data are on the same worksheet so they do get copied together.

Any other ideas?

- Drew

"Grey Newt" wrote:

The graph of course needs data to read from, so if you don't want a link to
the host workbook, you will need to copy the graph sheet AND its data sheet
together (ie simultaneously) to the new workbook.

Sheets(Array("Data", "Chart")).Select
Sheets(Array("Data", "Chart")).Copy


Martin



"Drew Lettington" wrote:

I have a worksheet that contains one chart and and the chart's source data in
rows and columns in that sheet. If I select the worksheet and then move it
to another workbook, the copied chart's source data still references the
worksheet in the original workbook.

For example, in Book1!Sheet1, the chart source data is 'Sheet1'!$A$1:$B$6.
When I copy the sheet to Book1, the chart source data is
'[Book1]Sheet1'!$A!1:$B!6.

Is there a way to have the source data in the copy reference the new
workbook or do I need to programmatically adjust the source data after
copying the sheet?