Solved

Querying and Merging Multiple Tabs in Excel into Summary Sheet

Posted on 2014-10-31
9
108 Views
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.

Thoughts?
Weekly-Status-Report.xlsx
0
Comment
Question by:duemes
[X]
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
  • 6
  • 2
9 Comments
 
LVL 47

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)
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40416600
Here's a preliminary solution.
Q-28548548.xlsm
0
 

Author Comment

by:duemes
ID: 40422526
Martin:

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
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 47

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.
Q-28548548.xlsm
0
 

Author Comment

by:duemes
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!!!
0
 
LVL 47

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.
0
 
LVL 47

Accepted Solution

by:
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 & "'", _
                        TextToDisplay:=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
    Next
    
    Application.ScreenUpdating = True
End Sub

Open in new window

0
 
LVL 47

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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

707 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