+ Reply to Thread
Results 1 to 8 of 8

Fastest way to copy values from one workbook to another

  1. #1
    Forum Contributor
    Join Date
    12-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    119

    Fastest way to copy values from one workbook to another

    Hi guys
    First: I don't know if this is a stupid question, but I'll try anyway. I'm not a an experienced VBA user at all.

    My problem is very simple: Copy all the values in a sheet from one workbook to another.
    I've noticed that nearly everyone suggests codes that includes
    Please Login or Register  to view this content.
    Isn't it possible to copy the values without 'opening' the 'database'-excel file, i.e. the excel file(s) where my data is stored?

    Wouldn't be "faster" if it did not have to open the file? Or do I have to 'open' the file since the code otherwise doesn't know where to copy the data from?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Fastest way to copy values from one workbook to another

    Try this un-tested code

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    12-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Fastest way to copy values from one workbook to another

    Hmm, @Sixthsense, it's not working for me. I get an error on the .sheets(sName) line.. Maybe I'm doing the lines before wrong?

    Please Login or Register  to view this content.
    EDIT: It works - I just had to split this code:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    I'll make further tests today - thanks so far!
    Last edited by Ztv; 07-15-2014 at 05:20 AM.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Fastest way to copy values from one workbook to another

    If you do not want to use Open file method, there is an option of ADO- Please go to Deburin's site.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Fastest way to copy values from one workbook to another

    Quote Originally Posted by Ztv View Post
    EDIT: It works - I just had to split this code:
    That's why I mentioned it is an un-tested code

  6. #6
    Forum Contributor
    Join Date
    12-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Fastest way to copy values from one workbook to another

    @AB33: Could you please elaborate? I don't know what you mean by "ADO" or who Deburin is...? Sorry.

    EDIT: Okay, I have now googled ADO and I can understand that is an "ActiveX Data Object" - right? Still, I don't know if it would be usefull in this situation...?
    Last edited by Ztv; 07-15-2014 at 07:23 AM.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Fastest way to copy values from one workbook to another


  8. #8
    Forum Contributor
    Join Date
    12-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    119

    Re: Fastest way to copy values from one workbook to another

    @AB33: Thx, I'll check it out later.

+ 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: 01-06-2013, 04:27 PM
  2. [SOLVED] Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook names
    By Arsham24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 07:42 PM
  3. Fastest way to compare two sheets and copy matches
    By Rodrigo Rocha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2010, 01:50 PM
  4. Fastest code to copy a range down
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2010, 07:54 PM
  5. Fastest way to fill in values on a form
    By wilro85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2007, 08:28 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