Results 1 to 8 of 8

Consolidate Multiple Worksheets Into One

Threaded View

  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!

    Dim ws As Worksheet, nrow As Integer
    Dim a As Integer, b As Integer
    nrow = 2
    For Each ws In ThisWorkbook.Worksheets
        If Not ws.Name = "Change Capture" Then
            a = Range(Cells(5, 2), Cells(5, 2).End(xlToRight)).Columns.Count + 1
    
            b = Range(Cells(5, 2), Cells(5, 2).End(xlDown)).Rows.Count + 4
    
            ws.Range(Cells(5, 2), Cells(b, a)).Copy
            Worksheets("Change Capture").Cells(nrow, a - 1).PasteSpecial Paste:=xlPasteValues
            nrow = Worksheets("Change Capture").Range(Cells(1, 1), Cells(1, 1).End(xlDown)).Rows.Count + 1
        End If
    Next ws
    Application.CutCopyMode = False
    Last edited by DGA2008; 03-29-2009 at 05:48 PM.

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