LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Chart links for copied sheets

Glad, after a nasty false start on my part, that you were able to get a
solution. (sorry about the false start).

--
Regards,
Tom Ogilvy

"andym" wrote in message
...
Tom,

this worked perfectly. I embedded this code into an existing procedure

that
creates an automatic name in which the new workbook gets saved.

Definiately a procedure to tuck away in the library for a future date.

Much appreciated ... I have now completed my project!!!

Regards,

andy m

Sub Tester1()
Dim bk as Workbook, varr as Variant
Dim i as Long
Worksheets(Array("Sheet1", "Sheet2")).Copy
Set bk = ActiveWorkbook
varr = bk.LinkSources(xlExcelLinks)
For i = LBound(varr) To UBound(varr)
bk.ChangeLink varr(i), bk.FullName, xlExcelLinks
Next
End Sub

Should do it for you. Change the arguments to array to as many sheets

as
you need, but make sure that you copy the source data with the charts.
Also, this assumes there are no other external links in the worksheets

that
you copy.

this creates the new workbook, but could be easily modified to an

existing
workbook with the same caution on existing links.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
for normal linking formulas like =Sheet1!A1:A10,
Rule1: If sheets with references and all the sheets they refer to are

copied
in one action, references are not set back to the original workbook.

If you get results different from this, see Rule 1.

--
Regards,
Tom Ogilvy








"andym" wrote in message
...
Tom,

I have done just that, but still have the same problem.

Here's an example of what I have done...

Original workbook has 12 sheets.
The last 5 sheets of these 12 are the sheets I have grouped and

copied
into
another workbook.

In the new book, Sheet1 contains the charts, Sheet4 contains the

data.
(Sheet8 and Sheet11 in the original workbook).
In the original workbook Sheet8 feeds off Sheet11. Once copied, the

new
Sheet1 feeds back off the old Sheet11, not the new Sheet4.

Hope that is not confusing :)

I used the following code to copy the required sheets...

Sheets(Array("Sheet8","Sheet9",..."Sheet12")).copy

This copied as expected, but as mentioned, left the data series

still
feeding off the orginal Sheet11.

Regards,

andy m


"Tom Ogilvy" wrote in message
...
Group the sheets and copy then all at once.

--
Regards,
Tom Ogilvy

"andym" wrote in message
...
Me Again!!

having successfully been able to copy 5 sheets of an original

workbook
into
a new workbook, I am having problems where all my links on

charts
etc
are
linking back to the original workbook.

Is there any way that I can set the data series of the charts to

stay
with
the accompanying data sheet, not the original workbook?

Of the 5 sheets I have copied over into their own workbook, 1 is

the
data,
the other the charts themselves.

Again, your help would be appreciated...

Regards,

andy m














 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graph links to copied sheet Miguel M Charts and Charting in Excel 1 June 24th 09 02:55 AM
how to unlink links copied from a list from the internet kmjmail Excel Discussion (Misc queries) 2 January 3rd 09 06:22 AM
Word O7 looses links with excel 07 when files copied to network fr Brian Links and Linking in Excel 1 November 28th 08 11:15 AM
Getting Sheets Copied From One Workbook to Another Without ....? Mhz New Users to Excel 6 July 18th 06 04:39 AM
Programatically Breaking Links of Copied Chart Sheet Matthew Wieder Excel Programming 1 July 18th 03 04:58 AM


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"