?
Solved

Combine Two Sheets

Posted on 2011-03-01
4
Medium Priority
?
236 Views
Last Modified: 2012-06-21
I need to combine the Sheets 'Team Dashboard Wip' and 'New Layouts'..the issue is that they both have controls and some code. I get errors when I try. Using two sheets when it could be simplified would be preferable, right?
Here is what I would like:
Move the 'New Layouts' content into 'Team Dashboard WIP' and use the control at the top of 'Team Dashboard WIP' to select the person and the appropriate data.
dashboard-wipv2.xlsm
0
Comment
Question by:singleton2787
[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
  • 2
  • 2
4 Comments
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35009606
Like this? Sample File Attached.

Sid

Code Used

Private Sub Worksheet_change(ByVal Target As Range)
    If Not Intersect(Target, Range("E5")) Is Nothing Then
        Dim acell As Range
        
        Set acell = Sheets("Graph Data Entry").Columns(1).Find(What:=Range("E5").Value, LookIn:=xlValues, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False)
    
        If Not acell Is Nothing Then
            Range("E9").Value = acell.Offset(2, 2).Value
            Range("E10").Value = acell.Offset(4, 2).Value
            Range("E11").Value = acell.Offset(6, 2).Value
            Range("E12").Value = acell.Offset(7, 2).Value
            Range("F9").Value = acell.Offset(2, 3).Value
            Range("F10").Value = acell.Offset(4, 3).Value
            Range("F11").Value = acell.Offset(6, 3).Value
            Range("F12").Value = acell.Offset(7, 3).Value
            Range("G9").Value = acell.Offset(2, 4).Value
            Range("G10").Value = acell.Offset(4, 4).Value
            Range("G11").Value = acell.Offset(6, 4).Value
            Range("G12").Value = acell.Offset(7, 4).Value
            Range("H9").Value = acell.Offset(2, 5).Value
            Range("H10").Value = acell.Offset(4, 5).Value
            Range("H11").Value = acell.Offset(6, 5).Value
            Range("H12").Value = acell.Offset(7, 5).Value
         
        End If
    ElseIf Not Intersect(Target, Range("E18")) Is Nothing Then
        Range("E21:E29").ClearContents
        For I = 1 To 100
            If Sheets("Data").Cells(1, I) = Range("E18").Value Then
                For J = 21 To 29
                    ActiveSheet.Cells(J, 5).Value = Sheets("Data").Cells(J - 19, I)
                Next J
                Exit For
            End If
        Next
    End If
End Sub

Open in new window

Dashboard-wip.xlsm
0
 

Author Comment

by:singleton2787
ID: 35009833
Almost!!
If we can just remove the control at E18 (the lower one) and just make E5 the control that displays all the data and graph, that would be optimal, thanks!!!
0
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 2000 total points
ID: 35009892
Like this? Sample File Attached.

Sid

Code Used

Dim acell As Range

Private Sub Worksheet_change(ByVal Target As Range)
    If Not Intersect(Target, Range("E5")) Is Nothing Then
        Set acell = Sheets("Graph Data Entry").Columns(1).Find(What:=Range("E5").Value, LookIn:=xlValues, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False)
    
        If Not acell Is Nothing Then
            Range("E9").Value = acell.Offset(2, 2).Value
            Range("E10").Value = acell.Offset(4, 2).Value
            Range("E11").Value = acell.Offset(6, 2).Value
            Range("E12").Value = acell.Offset(7, 2).Value
            Range("F9").Value = acell.Offset(2, 3).Value
            Range("F10").Value = acell.Offset(4, 3).Value
            Range("F11").Value = acell.Offset(6, 3).Value
            Range("F12").Value = acell.Offset(7, 3).Value
            Range("G9").Value = acell.Offset(2, 4).Value
            Range("G10").Value = acell.Offset(4, 4).Value
            Range("G11").Value = acell.Offset(6, 4).Value
            Range("G12").Value = acell.Offset(7, 4).Value
            Range("H9").Value = acell.Offset(2, 5).Value
            Range("H10").Value = acell.Offset(4, 5).Value
            Range("H11").Value = acell.Offset(6, 5).Value
            Range("H12").Value = acell.Offset(7, 5).Value
         
        End If
        Range("E21:E29").ClearContents
        For I = 1 To 100
            If InStr(1, Sheets("Data").Cells(1, I), Range("E5").Value, vbTextCompare) Then
                For J = 21 To 29
                    ActiveSheet.Cells(J, 5).Value = Sheets("Data").Cells(J - 19, I)
                Next J
                Exit For
            End If
        Next
    End If
End Sub

Open in new window

Dashboard-wip.xlsm
0
 

Author Closing Comment

by:singleton2787
ID: 35010941
You are the man!! Thanks
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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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