+ Reply to Thread
Results 1 to 4 of 4

Copy specific range from several workbooks with 2 sheets each located in same folder

  1. #1
    Registered User
    Join Date
    02-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    3

    Copy specific range from several workbooks with 2 sheets each located in same folder

    First: I'm a newbie in vb.
    I've been trying to combine different codes in the forum to get what I want but with no luck.
    Every day I get 4-5 excel-files in a folder, the workbooks has different names every day. From each workbook I want to copy range A6:C50 from every sheet. Each workbook contains 2 sheets with various names.
    I want to paste it in the open workbook in the first empty row. This workbook should also contain the macro.
    The problem is that I want everything I copy from the first sheet in every workbook to be pasted into columns A:C, and from the second sheet into columns F:H. The data from the second sheet could also be pasted into another sheet. I can manage this later with another code.
    I prefer to do this with the workbooks closed. (the workbooks I copy from)

    It's not always there is data in every row, so if it's possible to only copy the rows that contains a value in column A, it would be great.
    Greatful for all the help I can get since I'm not very good with vb.
    /rog
    Last edited by Rog; 02-06-2011 at 05:34 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy specific range from several workbooks with 2 sheets each located in same fol

    Edit the fPath string in this macro, then give it a try.

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 02-06-2011 at 05:53 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Copy specific range from several workbooks with 2 sheets each located in same fol

    Thanks, I will give this a try in the morning

  4. #4
    Registered User
    Join Date
    02-05-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    3

    Thumbs up Re: Copy specific range from several workbooks with 2 sheets each located in same fol

    Thank you very much for your time.
    This code worked fine, I just had to add one thing.
    When a sheet was blank the code stopped, so I just put in an error line.
    See underline below

    This code is saving me hours of work. I can use it for the daily reports, and modify it so I can sum up all the reports to a monthly report.
    Thanks again.


    /rog
    Please Login or Register  to view this content.
    [/QUOTE]
    Last edited by Rog; 02-09-2011 at 01:44 PM. Reason: spelling

+ 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