+ Reply to Thread
Results 1 to 2 of 2

VBA: Copy from one workbook to an other, but keep link

  1. #1
    Registered User
    Join Date
    09-15-2015
    Location
    Denmark
    MS-Off Ver
    office365
    Posts
    5

    VBA: Copy from one workbook to an other, but keep link

    Hi guys

    I have a problem, you might be able to help me with.

    I have two workbooks. I am able to create a macro, which allow me to copy a range(table) from workbook1 and insert it in workbook2.

    My code is very simple (just an example)

    workbook1.sheet1.range("xxx").copy
    workbook2.sheet2.range("yyy").PasteSpecial Paste:=xlPasteValues

    Now. Here is my question. At the moment I am inserting as values. Can I somehow insert in a way, so if something is changed in workbook1, then the values in workbook2 is changed as well, without running the macro? (a link between the two workbooks)
    You know, as one can do, when you have workbook2 open and write a function, where you refer to workbook1.

    The only solution I can come up with, is if I write a line of code for every cell I want to copy. Then I will do a cell at a time, but in my head a quicker solution must exist, where I can copy a range and insert it in a way, where I keep the link?

    Thank you

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,508

    Re: VBA: Copy from one workbook to an other, but keep link

    You can try pasting the links, I don't think there is a way to paste links without activating the destination workbook.

    At least it's a mass link, instead of one at a time

    Please Login or Register  to view this content.
    You could also use code to add the references with one line.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 05-28-2021, 08:06 PM
  2. [SOLVED] Copy Charts to new Workbook and Un-link Chart Data
    By Frenzyy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-29-2020, 03:34 AM
  3. Copy link last row values from another workbook using vba
    By Chadrick_06 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2015, 12:24 AM
  4. Macro to copy workbook and then link copy into a summary page
    By lockye in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2014, 02:38 PM
  5. 2007 Vba - Copy cell as a link to another closed workbook
    By smirker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2013, 08:07 AM
  6. Copy/Link Tab to Different Workbook
    By dhd2005 in forum Excel General
    Replies: 0
    Last Post: 04-05-2011, 11:52 AM
  7. [SOLVED] copy sheets with values only and NO link to old workbook
    By Roundy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2006, 02:21 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1