+ Reply to Thread
Results 1 to 5 of 5

VB Code to copy without opening the file

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to copy without opening the file

    Hello:

    Please refer to attached 2 excel files, one named as "Source" and other called "Destination".

    I need VB Code in "Destination" file to perform following:

    Without opening the Source file, I would like to copy cell B2:D12 from "Source" file to "Destination" file @ column letter shown in cell D1.

    I have manually copied as shown in "Destination" file.

    Please have a look and let me know if any questions.

    Thank you

    Riz Momin
    Attached Files Attached Files
    Last edited by rizmomin; 12-05-2013 at 08:25 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy without opening the file

    Hello:

    Can someone help with this thread please.

    Appreciate all the help i can get.

    Thank you

    Riz Momin

  3. #3
    Registered User
    Join Date
    08-11-2013
    Location
    leeds
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: VB Code to copy without opening the file

    There are ways to do this, querying the file as you would an sql database, but this is over my head to help with.


    Can I ask why you dont want to open the file?

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy without opening the file

    Hello:

    I will be copying data from lots of different files and hence i do not want to open.
    Just to let you all know that i am already using this feature with the below code successfully to paste at the fixed location at Cell "E5".
    I need to modify the code so that the column # reference is picked up from cell D1 of the active sheet.
    Please open the 2 excel file uploaded at the BEGINNING of this thread.

    Example: if Cell D1 = L, then "E5" needs to be replaced with L5.

    Please Login or Register  to view this content.
    Basically I want to modify the last line in above code where "E" needs to be variable and value can come from String called colpaste1.


    I hope this clear and would appreciate for any help.
    Thank you
    Last edited by rizmomin; 12-05-2013 at 08:03 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to copy without opening the file

    Hello:

    I have managed to solve the problem.
    Have changed the last line of the above code to:
    Please Login or Register  to view this content.
    And works great.

    Riz Momin

+ 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] Error in code - play music file automatically after opening file
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-15-2013, 10:06 AM
  2. [SOLVED] VBA-code for opening a file max x times
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-03-2013, 09:43 AM
  3. [SOLVED] Code for opening file if match with file name is found
    By cokillerliu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2013, 08:41 PM
  4. Error after opening file in vba code....cant figure out why
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2011, 04:09 PM
  5. Copy a sheet and save as new file, without opening the file
    By Chinnick in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2009, 05:00 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