+ Reply to Thread
Results 1 to 3 of 3

Consolidating Sheets Data

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-18-2008
    Posts
    123

    Red face Consolidating Sheets Data

    Hi,

    I need some help around the following:

    I have a file with 3 tabs: sheet 1, sheet 2, sheet3.

    I want to consolidated the data of these tabs in a single sheet, along with the tab name. The "consolidated" sheet in the attached file is my desired output that I need.

    Will you folks help me accomplish this? Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    macro

    HI
    Paste the following codes in the macro window (alt F11 insert > module)

    Sub consolidate()
    Dim a As Integer, x As Integer, z As Integer
    Range("A2:C10000").ClearContents
    For a = 2 To Sheets.Count
    x = Worksheets(a).Cells(Rows.Count, 1).End(xlUp).Row
    Worksheets(a).Range("A2:B" & x).Copy
    z = Worksheets("consolidated").Cells(Rows.Count, 2).End(xlUp).Row + 1
     Worksheets("consolidated").Range("A" & z & ":A" & z + x - 2) = Worksheets(a).Name
     Worksheets("consolidated").Range("B" & z).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
    Next a
    MsgBox "Listing is complete."
    End Sub
    run the macro

  3. #3
    Forum Contributor
    Join Date
    03-18-2008
    Posts
    123

    Thanks a lot for the help!!!!!

    Thanks a lot.. it worked for me...

+ 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