Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2015
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Copying range from each workbook in folder to another folder

    Hi,
    i'm looking for a macro to copy several rows of workbooks in a folder and then paste them to the workbooks in another folder that the workbooks in source folder and destination folder have the same name.

    thanks in advance

  2. #2
    3 Star Lounger Supershoe's Avatar
    Join Date
    Apr 2014
    Location
    Austin, TX
    Posts
    252
    Thanks
    1
    Thanked 36 Times in 34 Posts
    Try adapting this to your needs by looping
    Sub Iterate_Files()
    Dim ctr As Integer
    ctr = 1
    Path = "C:\Windows\ " ' Path should always contain a '\' at end
    File = Dir(Path) ' Retrieving the first entry.
    Do Until File = "" ' Start the loop.
    ActiveSheet.Cells(ctr, 1).Value = Path & File
    ctr = ctr + 1
    File = Dir() ' Getting next entry.
    Loop
    End Sub

  3. The Following User Says Thank You to Supershoe For This Useful Post:

    Romina (2015-01-07)

  4. #3
    New Lounger
    Join Date
    Jan 2015
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for your answer, but this macro returned my workbooks'name only
    i want that copy for example cells A3:BI20 of each my workbooks that they are in a folder and paste them into the A3:BI20 of workbooks in another folder.

  5. #4
    3 Star Lounger Supershoe's Avatar
    Join Date
    Apr 2014
    Location
    Austin, TX
    Posts
    252
    Thanks
    1
    Thanked 36 Times in 34 Posts
    This was to show you how to get the workbook. You then supply the rest. Search the archives as there are examples of exactly what you want.
    Don Guillett
    Excel Developer
    dguillett @gmail.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •