+ Reply to Thread
Results 1 to 4 of 4

Copying cells from multiple closed workbooks to active workbook

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Copying cells from multiple closed workbooks to active workbook

    Hello!

    I have a problem with Excel and VBA code. Let me first explain the situation. I have a folder called "Excel" and there are many Excel files. Also, in each Excel files' name there is a serial number, for example "14587454 File 1". Each of these files is a little different, but all contain a specific area that have the same headers A, B and C:

    A B C
    aaaaaa bbbbbb 1287
    ccccc ddddd 9647
    eeeee fffff 3641

    So this table is in all Excel files in the sheet "Cover", but on different row. Sometimes this table is on row 32 and sometimes on 35, depending on the Excel file.
    The purpose is to create a Master Excel file that will copy this table from all Excel files in the folder and paste them to Master Excel, and sorts them according to serial number in the file name . In the Master Excel file I have a macro button and the copying should be done when this button is clicked.

    I just started this project so I don't really have any sample VBA code. Could you guys help this newbie, please?
    Be sure to ask if anything is unclear (which is very possible).

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

    Re: Copying cells from multiple closed workbooks to active workbook

    http://www.rondebruin.nl/win/s3/win008.htm
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    04-15-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copying cells from multiple closed workbooks to active workbook

    Thanks patel45 for your reply!

    The code I got from that link is almost what I need.
    I forgot to say that I already have an existing Master Excel file in and in that file I have a macro button, which should do this copying and pasting. That code you gave creates a new 'Master Excel file' every time it is executed.
    Also, how can I change the code that it will find the headers A, B and C, and copy the content below them, even though the headers are on various rows depending on a file?

    Thanks in advance!

  4. #4
    Registered User
    Join Date
    04-15-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copying cells from multiple closed workbooks to active workbook

    I got this working by myself, but thanks patel45 really much for your help!

+ 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