+ Reply to Thread
Results 1 to 2 of 2

Help needed opening workbooks then copy and pasting!!

  1. #1
    Registered User
    Join Date
    02-17-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Help needed opening workbooks then copy and pasting!!

    Hi All,

    Strange request and I haven't a clue where to start!!

    I need to create a macro that will look at a list of .CSV files within a folder:

    Open each .CSV (one by one)
    copy all the data from column A
    Paste into column A of the result sheet
    close the .CSV
    ------------
    open the next .CSV
    copy the data from column A
    Paste into column B of the result sheet
    close the .CSV
    ------------
    open the next .CSV
    copy the data from column A
    Paste into column C of the result sheet
    close the .CSV
    ------------
    and so on, and so on etc.

    The 'result' workbook would be one worksheet containing each of the column A contents from the opened .CSV files.

    Probably not too tough for you genius minds out there, but I'd love to understand how the code ticks!

    Can anyone help please?

    Thanks for looking!

    Guy

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Help needed opening workbooks then copy and pasting!!

    There's no 'short' way to do it, really. Ron de Bruin offers the following on his website (which is great!)...

    Please Login or Register  to view this content.
    You will need to change your folder path, file extension (to .csv) and source range (your Column A as outlined in your original post).

    Good luck

    -as-
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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