+ Reply to Thread
Results 1 to 8 of 8

Consolidate Multiple Worksheets Into One

  1. #1
    Registered User
    Join Date
    06-10-2008
    Posts
    26

    Consolidate Multiple Worksheets Into One

    Hello all,

    I have attempted to code a "capture" worksheet that will consolidate other worksheets into an importable template. The problem i'm having is when I run my code I beleive it is referenceing the capture page, instead of the other worksheets. I know there are a few ways to accomplish this, one being to reference the other pages through name or location. This will not work as the other sheet names and locations will change, the only constant is the page where all will be consolidated "change capture".

    I beleive it is misreferencing as it points to a being 256, and b being 0... both should have different values.

    I would like the capture page to consolidate downwards (begin the second paste after the last line of the previous paste).

    Thank you in advance for your help!

    Please Login or Register  to view this content.
    Last edited by DGA2008; 03-29-2009 at 05:48 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Consolidate Multiple Worksheets Into One

    Maybe like this:
    Please Login or Register  to view this content.
    Last edited by shg; 03-29-2009 at 02:31 PM. Reason: moved a line of code
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-10-2008
    Posts
    26

    Re: Consolidate Multiple Worksheets Into One

    Thanks for your help, I'm stil getting an error in the code it seems. The error was Method 'Range' of object '_Worksheets' failed. wks.name properly referenced the sheet but the code stopped at iCol with a value of '0'.

    What am i missing still? Does the sheet need to be activated for it to reference a cell and count?

    Thanks again

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Consolidate Multiple Worksheets Into One

    DGA2008,

    It would help if you could post your workbook - scroll down and see "Manage Attachments".


    I stepped thru code, and some data in sheet1, 2, 3.

    After the first copy from sheet1, "nrow" had a value of 65536. This will prevent the paste for other sheets, and the error.


    Have a great day,
    Stan
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Registered User
    Join Date
    06-10-2008
    Posts
    26

    Re: Consolidate Multiple Worksheets Into One

    Attached is a copy of the worksheet. What i would like to do is copy the contents from each sheet (from below the field headings to the end of the list and as wide as the fields listed) and consolidate into the "Change Capture" sheet. There should only be 30-100 rows copied per sheet at most, as the data shows...

    Thank you for your help.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Consolidate Multiple Worksheets Into One

    DGA2008,

    Your original workbook VBA area was Password Protected. I copied the sheets to a new workbook.

    See the attached workbook "Tracking_Dist(1) - DGA2008 - SDG.xls", with a new macro "CopySheets".

    Run macro "CopySheets".


    Have a great day,
    Stan
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-10-2008
    Posts
    26

    Re: Consolidate Multiple Worksheets Into One

    Works perfectly! Thank you for your help with the code!

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Consolidate Multiple Worksheets Into One

    Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ 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