+ Reply to Thread
Results 1 to 5 of 5

Copy data from one workbook to another

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    34

    Copy data from one workbook to another

    I would like to vba code where each time data is inserted to one workbook, that a closed workbook can be updated with the information. It would be any data that is added to the first workbook. There would be no specific cells to identify, just the entire workbook, including each worksheet within the workbook. I would greatly appreciate any assistance with this and it would be a big help if this is at all possible!

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy data from one workbook to another

    It's not very clear for me, can you explain better ?
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy data from one workbook to another

    Hi, codesRus,

    only way to write to a closed workbook to my knowledge is using ADO. With Excel VBA you have to open the workbook. Or use lots of formulae to combine and be asked to update when opening the workbook.

    Wouldn´t it be easier to save a copy with Date and Time as backup when the original file is closed?

    Ciao,
    Holger

    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [ code ] Your code here [ /code ] (without the spaces inside the brackets)

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Copy data from one workbook to another

    Quote Originally Posted by patel45 View Post
    It's not very clear for me, can you explain better ?
    Sure!

    Basically I have two copies of the same workbook (one macro enabled .xlsm, one is just an .xlsx). I want to primarily use the workbook with the .xlsm extension to insert the data and as I do this, that the it will automatically update the non-macro workbook. This is with each time I insert data into the cells that it will trigger the closed workbook, and when that one is opened, it'll have the updated information.

    I'm not sure if it is possible to do this or not. I know that some codes have a row or specific cells identified in it, but I want the entire worksheet.

    ---------- Post added at 04:13 PM ---------- Previous post was at 04:12 PM ----------

    Hello HaHoBe,

    I'm not sure what ADO is. Will this be easier to keep updated information on each workbook?

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy data from one workbook to another

    Hi, codesRus,

    have a look at Use a closed workbook as a database (ADO) for more information on the subject and code as well. ADO stands for Microsoft ActiveX Data Objects 2.x where x represents the different versions (mine go from 2 to 8 on my desktop). This reference has to be checked in the VBE under Options/References.

    Ciao,
    Holger

    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [ code ] Your code here [ /code ] (without the spaces inside the brackets)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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