+ Reply to Thread
Results 1 to 6 of 6

How to copy rows from various sheet into 1 rolling sheet

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    How to copy rows from various sheet into 1 rolling sheet

    Hi all,

    The following problem exists...
    I have an Excel2003 file which contains various sheets. They are named like "aa Pegatron", "bb Pegatron" etc. These sheets can contain any number of lines with data (up to max 5000 lines). The sheets have all the same format / layout.
    I now need a macro to pull the data of all non-empty lines in columns D, E, F, H and J from all these various sheets into 1 accumulated sheet named "Overall sheet".

    What code do I need to use so that the macro would recognize the different sheetnames (whereby Pegatron is the fixed value but the aa, bb, cc etc in front of it will change in the sheetname) and whereby all lines in these sheets are copied into the overall sheet without overwriting any existing lines in that sheet.

    Attached an example file for your reference.

    Any help would be highly appreciated!!
    Peter
    Attached Files Attached Files
    Last edited by Bax; 10-25-2010 at 10:09 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: How to copy rows from various sheet into 1 rolling sheet

    In your actual sheet:

    1) open the VBEditor (Alt-F11)
    2) Insert an empty module (Insert > Module)
    3) Paste in this macro code
    Please Login or Register  to view this content.

    4) Open the ThisWorkbook module and paste in this code:
    Please Login or Register  to view this content.

    5) Open the Overall Sheet module and paste in this code:
    Please Login or Register  to view this content.

    6) Close the editor and save your workbook


    Now every time you open the workbook or bring up the Overall Sheet onscreen the data will refresh from every other sheet with the word "Pegatron" in the sheet name.
    Attached Files Attached Files
    _________________
    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
    10-25-2010
    Location
    HOUSTON, TEXAS
    MS-Off Ver
    Excel 2007
    Posts
    1

    copy/paste objects such as small circles and squares from one location to another

    excel 2007

    i have an issue which i would much appreciate your assistance on:

    for those of you who use excel data sheets, you woud know that you use small cirles, either filled in black or left white, to show preferences, etc. i am experiencing that when i have to do a copy and paste, to move the copy of one circle to another location, i click on the first one, the original--this circle already moves about five rows away, and then when i paste ok at the proposed location, again it gets pasted far away from where it was targeted for. it is a little frustrating!

    thank you

  4. #4
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    Re: How to copy rows from various sheet into 1 rolling sheet

    Hi JBeaucaire,

    Many thanks for the fast reply!

    Works fine, I only didn't paste the code in the "ThisWorkbook" as the file seems to go into an indefinite loop... without this code it works fine as soon as I open the "Overall sheet"!

    If you don't mind spending a few more minutes on this, I have an additional question...
    On the various "Pegatron" sheets, there are e.g. all max 5000 lines prefilled with VLOOKUP formulas etc. So I have row 2 up to 5000 filled with "#N/A" data in the colums D, E, F, H and J until this gets filled.

    The code that you provided is pulling all these "#N/A" data in the "Overall sheet" as well. Is there anything that I (or you to be more exact... ) could add in the code that would overlook the "#N/A" lines in the various sheets?

    And again, many thanks for your help here... is saving us lots of time...

    Peter

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

    Re: How to copy rows from various sheet into 1 rolling sheet

    Try this, it will examine the imported data for errors in column A and delete those rows.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    Re: How to copy rows from various sheet into 1 rolling sheet

    Terrific!! Works perfectly!

    Many many thanks!

+ 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