+ Reply to Thread
Results 1 to 5 of 5

Open list file and copy sheet

  1. #1
    Registered User
    Join Date
    03-18-2012
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    42

    Open list file and copy sheet

    Hi,

    i'm hoping someone here can give me some directions with a macro i'm trying to create

    I'm trying to create a macro that will look at a list of files open the first one and then search the sheet names and if the sheet names matches the file name copy the sheet to the opened file.

    example:

    file 1:
    sheet1 Contains a list of file name and path
    sheet2: apple
    Sheet3: banana
    Sheet4: car


    macro will open first file in list and lets assume it is called apple.xlsx

    it will open file and then search file 1 sheet name and if there is a sheet called apple it will copy the sheet to the opened file.


    it will continue doing this until the list is complete

    fairly new to macro and need some directions as to how to complete this. any help is greatly appreciated

    attached a file for sample

    thanks a million
    Attached Files Attached Files

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

    Re: Open list file and copy sheet

    Are the sheets apple, car ... already existing in the masterfile ? it would be better no existing.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    03-18-2012
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Open list file and copy sheet

    Hi Patel45,

    yes, the masterfile will have all the sheets apple, car....

    my goal is to have it open the list of file one by one and then if one of the sheet name in the masterfile matches the file name to copy that sheet and paste

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

    Re: Open list file and copy sheet

    1) read file name from cell C3 and path from cell D3 C:\Users\Desktop\apple.xlsx
    2) open C:\Users\Desktop\apple.xlsx
    3) copy sheet apple from MasterSheet
    4) paste in C:\Users\Desktop\apple.xlsx

    is it correct ?

  5. #5
    Registered User
    Join Date
    03-18-2012
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Open list file and copy sheet

    Hi Patel45,

    yes, that is correct.

    do you know of any macro that can do this?

    I appreciate your help.

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

    Re: Open list file and copy sheet

    Please Login or Register  to view this content.

+ 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] VBA to Open File (filename contains current date) & copy Sheet to active workbook
    By jlstidham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2013, 10:50 PM
  2. open file base on the list and copy some information.
    By lie21073 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2013, 05:26 PM
  3. [SOLVED] Open Excel file with filedialog and copy it into sheet 2
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-14-2012, 09:37 AM
  4. [SOLVED] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  5. use file list to open files to copy cells over
    By chi11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2012, 12:25 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