+ Reply to Thread
Results 1 to 5 of 5

Moving data from one workbook to another

  1. #1
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Post Moving data from one workbook to another

    I have two workbooks: WorkbookA and WorkbookB. (Attached)
    I want to copy the values for the person with ID number: IG1 from workbookA to the corresponding sheet in workbookB. The sheet for IG1 would be sheet "Test person 1" as cell B1 in this sheet, contains the corresponding ID (IG1).
    There are already values in the cells (32, 7 and 1) in WorkbookB (sheet: test person 1), these values should be replaced by 5, 8 and 12 (from WorkbookA), respectively.

    This procedure should then continue for the next ID (IG2), and so forth. If the ID is not found in workbookB, it should skip it, and go to the next ID, until there are no more IDs.

    So i need a code that compares the ID from column A in WorkbookA, with its corresponding ID, which is located in one of the "Test person" sheets in workbookB, in cell B1. It should then copy and paste the corresponding values (value 1, value 2 and value 3) that matches the ID, from workbookA, to the cells D2, E2 and F2 in workbookB.

    Thank you very much!
    Attached Files Attached Files
    Last edited by Allerdrengen; 07-13-2017 at 07:03 AM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,882

    Re: Moving data from one workbook to another

    I'd use ADO.

    Please Login or Register  to view this content.
    Save both attached to same folder. And while WorkbookA is closed, run code in WorkbookB.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Moving data from one workbook to another

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 07-12-2017 at 10:56 AM.

  4. #4
    Registered User
    Join Date
    04-03-2017
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    92

    Re: Moving data from one workbook to another

    Thank you! It works perfectly.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Moving data from one workbook to another

    You're welcome. Glad to help out and thanks for the feedback and rep. Please mark this thread as SOLVED.

+ 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. Moving data between worksheets within the same workbook
    By CountryPenguin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-26-2015, 12:41 PM
  2. Moving Data from One Workbook to Another Workbook
    By abutler911 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-16-2013, 04:10 PM
  3. Moving data between two workbook with one a variable name
    By Scans in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2012, 07:35 PM
  4. Replies: 4
    Last Post: 09-15-2012, 02:18 PM
  5. Moving data to a closed workbook
    By bouncey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2010, 10:31 PM
  6. Moving Changing data to new tab in workbook
    By Lime in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-23-2005, 11:40 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