+ Reply to Thread
Results 1 to 3 of 3

copy data from a range in multiple sheet to master sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    09-05-2010
    Location
    abu Dhabi
    MS-Off Ver
    Excel 2003
    Posts
    9

    copy data from a range in multiple sheet to master sheet

    Hi,

    I have searched in almost all the forums, but i have not been able to achieve what i need. I have to create a work sheet for my manager where he will assign different task/projects to us, and the same would be a updated in a shared file kept in our common DIR thus whenever we open we can view our individual sheets view the task assigned and update accordingly.

    Now, i have already created a Master sheet where task assigned gets populated on individual sheet but i am stuck at is how get the master sheet updated for column (Status) & column(update) when we update our sheets in column (F) & column (G) the same needs to be updated on master sheet ?

    Formula/macro anything is it possible?
    Attached Files Attached Files
    Last edited by kumaramitoujjain; 10-26-2010 at 04:43 AM. Reason: solved

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: copy data from a range in multiple sheet to master sheet

    Attach the following code to a update on the Master worksheet. You cannot use vllokup on this problem since it will cause an almost circular reference and the individual worksheets will loose their data.

    ' update the status and update fields for each master task
    Private Sub Update_Click()
    
        Dim sh As Worksheet
        Dim i As Long
        Dim Found As Boolean
        Dim rw As Range
        Dim theRows As Range
    
        ' get the rows of the master sheet and loop through them
        Set theRows = Me.Range("2:" & CStr(Me.UsedRange.Rows.Count))
        For Each rw In theRows.Rows
    
            ' exit if the assigned to value is blank
            If (rw.Cells(1, 2).Value = "") Then Exit For
            Found = False
    
            ' get the reference worksheet.
            On Error Resume Next
            Set sh = Worksheets(rw.Cells(1, 2).Value)
            If (Err.Number = 0) Then
    
                ' find the taks assigned
                For i = 4 To sh.UsedRange.Rows.Count
                    If (sh.Cells(i, 2).Value = rw.Cells(1, 3).Value) Then
    
                        ' extract the Status and Update fields
                        rw.Cells(1, 7).Value = sh.Cells(i, 6).Value
                        rw.Cells(1, 8).Value = sh.Cells(i, 7).Value
                        Found = True
                        Exit For
                    End If
                Next i
            End If
            On Error GoTo 0
    
            ' if Assigned To or Task was not found, write ???
            If (Not Found) Then
                rw.Cells(1, 7).Value = "???"
                rw.Cells(1, 8).Value = "???"
            End If
        Next rw
    
    End Sub
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  3. #3
    Registered User
    Join Date
    09-05-2010
    Location
    abu Dhabi
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: copy data from a range in multiple sheet to master sheet

    Thank you thank you thank you yes it does what i wanted thank you

+ 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