+ Reply to Thread
Results 1 to 8 of 8

macro to transfer data to another workbook

  1. #1
    Registered User
    Join Date
    11-28-2022
    Location
    england
    MS-Off Ver
    365
    Posts
    28

    macro to transfer data to another workbook

    hello. I have a master workbook that needs updating weekly and I've tried to create a macro but I have had no success so any help will be much appreciated



    my master workbook has all my data and I export data from my system weekly and it has up-to-date information. I would like the macro to run a loop of all the rows in the weekly report and copy and paste the new rows to my master workbook by identifying the new codes in column C (unique ID). the macro will also need to update column N & O in the master workbook if the date is changed in the weekly report.



    I have attached 2 workbook samples. please note, the master workbook has more columns.

    master workbook sample.xlsxweekly report sample.xlsx

    thank you for taking the time to help me.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: macro to transfer data to another workbook

    For clarification:
    You want to copy the rows from the weekly report to the master workbook only if the Unique ID in the weekly report does not exist in the master.
    If the Unique ID in the weekly report exists in the master, you want to update N & O in the master if the dates have changed in the weekly report.
    Is this correct?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    11-28-2022
    Location
    england
    MS-Off Ver
    365
    Posts
    28

    Re: macro to transfer data to another workbook

    hi Mumps1,

    yes that's correct.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: macro to transfer data to another workbook

    Place this macro in the master workbook. Make sure that both workbooks are open before running the macro. Change the sheet names (in blue) and file name (in red) to suit your needs.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-28-2022
    Location
    england
    MS-Off Ver
    365
    Posts
    28

    Re: macro to transfer data to another workbook

    hi, any reason why im getting an error code, error time error 457: this key is already associated with an element of this collection

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: macro to transfer data to another workbook

    It means that you have duplicate ID's in column C of the Master workbook. Those ID's are supposed to be unique.

  7. #7
    Registered User
    Join Date
    11-28-2022
    Location
    england
    MS-Off Ver
    365
    Posts
    28
    Quote Originally Posted by Mumps1 View Post
    It means that you have duplicate ID's in column C of the Master workbook. Those ID's are supposed to be unique.
    Yes,for some reason there was a duplicate. Now resolved

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: macro to transfer data to another workbook

    Glad it worked out.

+ 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. [SOLVED] Macro to Transfer Data from One Workbook to Another
    By The_Snook in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-27-2017, 10:02 AM
  2. [SOLVED] How to transfer data from one workbook to another workbook using Macro
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2016, 12:27 PM
  3. Replies: 3
    Last Post: 02-21-2014, 09:05 AM
  4. [SOLVED] need help on a macro to transfer data to another workbook
    By aftonr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-10-2012, 11:47 AM
  5. Macro to transfer data from one workbook to another
    By Sean Anderson in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-16-2011, 01:37 PM
  6. Transfer data fron one workbook to another using macro
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2010, 11:46 AM
  7. Transfer data fron one workbook to another using macro
    By nachousa in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2010, 11:45 AM

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