Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Querying and Merging Multiple Tabs in Excel into Summary Sheet

Posted on 2014-10-31
Last Modified: 2014-12-03
See attached excel document.

I'm trying to create a summary tab in a spreadsheet using data that exists in multiple tabs. I'd like this to be dynamic, such as a add new tabs, the summary tabs accounts for the new tab. Also, when I hide the tabs I don't want the summary tab to include it in the summary.

Question by:duemes
  • 6
  • 2
LVL 46

Expert Comment

by:Martin Liss
ID: 40416551
Is a VBA solution OK?

Where do I get the data for the Work Request #?
Is the source for "Project Title" B4?
Is the source for "Project Go-Live Date"  B5? (BTW you have "Anticpated" spelled incorrectly)
LVL 46

Expert Comment

by:Martin Liss
ID: 40416600
Here's a preliminary solution.

Author Comment

ID: 40422526

I'm so sorry on not getting back to you. I never received an email when you answered this post. You are correct the source for Project Title is B4 and the source for Projected Go-Live Date is B5. As for the Work Request #'s they are gotten from tab names. The tab names then populate the Work Request # field in B3

PS Thanks for letting me know the misspelling of anticipated
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

LVL 46

Expert Comment

by:Martin Liss
ID: 40422896
I'm not exactly sure what "The tab names then populate the Work Request # field in B3" means but try the attached project. If any field on Summary tab is incorrect please tell me what the value should be.

Author Comment

ID: 40423717
Looks great! Exactly what I wanted. Last thing.... anyway on the status page to get the Work Request #'s to link to their appropriate tabs as a hyperlink? Also, I'm going to be adding a new tab lets call it Allocation which I don't want include on this summary tab. I see in the code the following. How would I say don't do this if the sht.Name is "Allocation"

If sht.Visible And sht.Name <> "Summary" Then

Thanks so much for all your help. I've got to tell you. When I envisioned this spreadsheet, this is exactly what I was hoping for - thanks to you!!!
LVL 46

Expert Comment

by:Martin Liss
ID: 40424411
Adding hyperlinks always takes me a while since I don't do it very often but I'm working on it.
LVL 46

Accepted Solution

Martin Liss earned 500 total points
ID: 40424452
Well that was easier than I thought:)

Here's the code. There are several ways to add another name to the group of sheets that shouldn't be processed, but the Select Case statement is probably the cleanest and easiest to maintain.
Private Sub Worksheet_Activate()

    Dim sht As Worksheet
    Dim lngRow As Long
    lngRow = 3
    Application.ScreenUpdating = False
    ActiveSheet.UsedRange.Cells.Offset(3, 0).ClearContents
    ActiveSheet.ListObjects("Table3").Resize Range("$A$3:$F$4")
    For Each sht In Worksheets
        If sht.Visible Then
            Select Case sht.Name
                Case "Summary", "Allocation"
                    ' Don't process these two sheets
                Case Else
                    lngRow = lngRow + 1
                    With ActiveSheet
'                        Cells(lngRow, 1).Value = sht.Name
                        ' Hyperlink description:
                        ' Anchor: A Range or Shape object to set as the location of the hyperlink.
                        ' Address: The URL to navigate to when the hyperlink is clicked.
                        ' SubAddress: A location on the page. SubAddress is appended to Address and preceded by #.
                        ' ScreenTip: A tool tip to display when the mouse pointer pauses over the hyperlink.
                        ' TextToDisplay: The text to show on screen in place of the hyperlink.
                        .Hyperlinks.Add Anchor:=.Cells(lngRow, 1), _
                        Address:="", _
                        SubAddress:="'" & sht.Name & "'!" & Sheets(sht.Name).Range("A1").Address, _
                        ScreenTip:="Jump to sheet '" & sht.Name & "'", _

                        .Cells(lngRow, 2).Value = sht.Range("B4").Value
                        .Cells(lngRow, 3).Value = sht.Range("B6").Value
                        .Cells(lngRow, 4).Value = sht.Range("B7").Value
                        .Cells(lngRow, 5).Value = sht.Range("B5").Value
                        .Cells(lngRow, 6).Value = sht.Range("G3").Value
                    End With
            End Select
        End If
    Application.ScreenUpdating = True
End Sub

Open in new window

LVL 46

Expert Comment

by:Martin Liss
ID: 40478148
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question