+ Reply to Thread
Results 1 to 5 of 5

Need VBA to find matching data between worksheets & copy adjacent rows.

  1. #1
    Registered User
    Join Date
    05-28-2012
    Location
    Sydney Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Need VBA to find matching data between worksheets & copy adjacent rows.

    I would really appreciate it if someone could create a VBA for me.

    I am using Excel 2007. I use a MASTER sheet to input all employee time and wage information. In the same workbook I also have separate worksheets for each employee. I input all employee wage information into the MASTER sheet and need a macro to transfer each employee’s data to their own sheet on the row that corresponds to that payweek. In the MASTER worksheet I created a column labelled “EMPLOYEE-DATE” where I input each employee’s name and the payday shown as a number. I only want to copy information from the cells to the right of “EMPLOYEE DATE” on the MASTER sheet (I have shaded this section on my sample worksheet). The EMPLOYEE sheets already have the same column headers as the MASTER sheet and have had the “EMPLOYEE-DATE” column completed in column A.

    When the value of a cell in column AC of the MASTER sheet matches a cell in one of the EMPLOYEE sheets, I would like to copy the contents of AD to BU from that same row in the MASTER sheet to the EMPLOYEE sheet in the same row that contains the matching value - at columns C to AT.

    After the employee worksheets have been updated I would like to clear the data in the MASTER sheet without wiping out the information in the Employee worksheets.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need VBA to find matching data between worksheets & copy adjacent rows.

    Helen,
    This is really massive job.
    Try the attached.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-28-2012
    Location
    Sydney Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Need VBA to find matching data between worksheets & copy adjacent rows.

    Thank you so much .. Worked brilliantly!!

    The only thing was that I wanted to keep the headers in the master sheet and it was getting cleared out completely so I eliminated the line ".Cells.Clear" and created a separate macro to clear out the input data lines on the master sheet. I am very happy with the result - Thanks again

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need VBA to find matching data between worksheets & copy adjacent rows.

    Helen,
    Use this line instead

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-28-2012
    Location
    Sydney Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Need VBA to find matching data between worksheets & copy adjacent rows.

    Thank you - All working perfectly ***

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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