Solved

Combine Two Sheets

Posted on 2011-03-01
4
228 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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 tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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…
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…

726 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