+ Reply to Thread
Results 1 to 2 of 2

Sync cells over multiple workbooks with VBA

  1. #1
    Registered User
    Join Date
    01-20-2021
    Location
    Frankfurt
    MS-Off Ver
    2016
    Posts
    2

    Sync cells over multiple workbooks with VBA

    Hello everyone,

    I have a special request that I cant solve on my own. I searched all over the internet but could not find anything. I really want to prusue my goal because I am an intern at my company.

    I have two documents ("workbooks"). One is called "Doc1", the other one is called "Doc2". Both documents comprise of one table "Table1".
    I want to sync the cells A1 between Doc1_Table1 and Doc2_Table1. This needs to work in both ways, e.g. if I make changes in Doc1_Table 1 cell A1, it should sync to Doc2_Table1 cell A1 and vice versa.
    I already found a way to sync cells from different tables WITHIN one document. But don't know how to change the code to sync over two documents.

    WITHIN the document I can sync two cells over different tables (e.g. table1 & table2) like that:

    (this is what i put into table1 to connect to table 2 - and in table two i have the same but replaced for table1)

    Please Login or Register  to view this content.
    Private Sub Worksheet_Change (ByVal Target As Range)
    If Intersect (Taget, Range ("A1")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Sheets("Table2") .Range("A1") = Target
    Application.EnableEvents = True
    End Sub
    Please Login or Register  to view this content.
    now i need a smiliar code but OVER the two documents.. please help!

    One idea was to define the location more precisely:

    Please Login or Register  to view this content.
    Private Sub Worksheet_Change (ByVal Target As Range)
    If Intersect (Taget, Range ("A1")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Workbooks("Doc1.xlsm").Sheets("Table1") .Range("A1") = Target
    Application.EnableEvents = True
    End Sub
    Please Login or Register  to view this content.

    But this did not work either!

    Your help is highly appreciated! Thank you very much!
    HTML Code: 
    [/HTML]
    Last edited by excel.loser_pls.help; 01-27-2021 at 12:29 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Sync cells over multiple workbooks with VBA

    Please note that you have ignored two or our most basic forum rules you agreed to abide by when you joined.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    Please repair both of these issues.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Sync two workbooks
    By ninny_ in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-29-2019, 04:16 PM
  2. Sync Excel Workbooks without Macros
    By Tina007 in forum Excel General
    Replies: 1
    Last Post: 08-13-2018, 11:12 AM
  3. Slicers to sync multiple pivots from multiple data sources?
    By cantona_lives in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 06-21-2017, 12:33 PM
  4. [SOLVED] Keeping cells in sync
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2017, 11:11 PM
  5. Linked workbooks don't sync when new rows are inserted
    By Phorbox in forum Excel General
    Replies: 1
    Last Post: 04-06-2012, 07:00 AM
  6. Sync two (actively changing) workbooks
    By Tsaukpaetra in forum Excel General
    Replies: 4
    Last Post: 01-19-2010, 04:48 PM
  7. [SOLVED] Excel compare workbooks: need to interrupt and resume sync scroll
    By Al in Ladner in forum Excel General
    Replies: 0
    Last Post: 06-14-2005, 03:05 PM

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