+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : Consolidating different values under different Names inDifferent Tabs to Master Sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    02-21-2012
    Location
    Noida,India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question Consolidating different values under different Names inDifferent Tabs to Master Sheet

    Hi,
    I want to consolidate values against a particular Name in a master sheet.

    - I have 48 Tabs in Excel sheet.
    - Each Tab has some Names & some values..(Ex. A=7,B=4,F=65 etc)
    - The existence of Names (A,B,C etc) are random in a particular tab.Ex. It is not necessary that 'A' is available every time in a tab.
    - I want to consolidate all 48 Tabs into a master Summary tab (say 49) where i want to do a total of whatever names (A,B,C,D,E,F,,etc) exist in 48 tabs.
    - Problem is there is no symmetry in any two tabs.
    Please help me.I don't want to do it manually.
    Attached Files Attached Files
    -Rajeev

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Consolidating different values under different Names inDifferent Tabs to Master S

    Hi Rajeev. See if this is what you're looking for.
    Sub Consolidate()
        Dim mWS     As Worksheet
        Dim WS      As Worksheet
        Dim rInput  As Range
        Dim rOutput As Range
        Dim iSNO    As Integer
        Dim rFound  As Range
        Dim vItem   As Variant
        
        Set mWS = Sheets("Summary")
        For iSNO = 65 To 90
            For Each WS In ThisWorkbook.Sheets
                Set rFound = WS.Range("A:A").Find(Chr(iSNO), LookIn:=xlFormulas, lookat:=xlWhole)
                If Not rFound Is Nothing Then
                    Set rInput = Range(rFound, rFound.Offset(0, 1).End(xlDown))
                    Set rInput = rInput.Resize(rInput.Rows.Count, 5)
                    Set rOutput = mWS.Cells(Rows.Count, 2).End(xlUp).Offset(2, -1)
                    rInput.Copy rOutput
                End If
            Next
        Next
        
        For Each vItem In Array(xlEdgeBottom, xlEdgeLeft, xlEdgeRight, xlEdgeTop, xlInsideHorizontal, xlInsideVertical)
            mWS.Range(mWS.Cells(Rows.Count, 2).End(xlUp).Offset(0, 3), "A1").Borders(vItem).LineStyle = xlContinuous
        Next
        
        Set rFound = Nothing
        Set rInput = Nothing
        Set rOutput = Nothing
        Set mWS = Nothing
    End Sub
    Attached Files Attached Files
    -Greg If this is helpful, pls click Star icon in lower left corner

+ 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