+ Reply to Thread
Results 1 to 7 of 7

Copy a row from 3000 excel files stored in a folder and paste it in a new workbook

  1. #1
    Registered User
    Join Date
    07-27-2009
    Location
    Bratislava, Slovakia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Question Copy a row from 3000 excel files stored in a folder and paste it in a new workbook

    Hi,

    Here's my situation:

    I have 3000 workbooks in a folder.
    Each has a worksheet named "Sheet1"
    There are 13 colums and 2 rows of data in Sheet1.

    I need to copy the second row from all excel files stored in the folder and
    paste them into a blank workbook.

    I really do not know how to proceed with this. I have basic VBA knowledge.

    Thank you very much for any advice, I will greatly appreciate it.
    Last edited by hubertus; 07-28-2009 at 10:14 AM.

  2. #2
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Copy a row from 3000 excel files stored in a folder and paste it in a new workboo

    The following should do as you require. Note that you will need to set the folder to look in appropriately.
    This code should be placed into a module in the VBE.

    Please Login or Register  to view this content.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  3. #3
    Registered User
    Join Date
    07-27-2009
    Location
    Bratislava, Slovakia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy a row from 3000 excel files stored in a folder and paste it in a new workboo

    Thank you!! Works like a charm!

    If it's not too much trouble for you, could you please explain the code a little bit? I'd very much like to learn some new VBA stuff.

    Thank you again!

  4. #4
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Thumbs up Re: Copy a row from 3000 excel files stored in a folder and paste it in a new workboo

    Sorry, I would normally comment the code for posters to learn from, but I was rushed when posting this

    Here it is with some comments. Any other questions feel free to ask

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-27-2009
    Location
    Bratislava, Slovakia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy a row from 3000 excel files stored in a folder and paste it in a new workboo

    Awesome! Thank you!

  6. #6
    Registered User
    Join Date
    07-27-2009
    Location
    Bratislava, Slovakia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy a row from 3000 excel files stored in a folder and paste it in a new workboo

    Hi Phil!

    Thank you again for the code, works great.

    However, i came accross a little setback while using it. The code copies cells incl. formulas in them. Is it possible to copy just values?

    I know how to copy and paste values between sheets but I am not able to do that between workbooks. I tried to modify your code to this, but I wasnt successfull.

    Could you help me with this as well?

    Thank you!!

  7. #7
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Copy a row from 3000 excel files stored in a folder and paste it in a new workboo

    I think the following change should do it for you:

    From:
    Please Login or Register  to view this content.
    To:
    Please Login or Register  to view this content.
    Hope that helps

+ 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