+ Reply to Thread
Results 1 to 3 of 3

Matching two sets of Data

Hybrid View

  1. #1
    Registered User
    Join Date
    06-17-2008
    Posts
    7

    Matching two sets of Data

    Good Morning All,

    I do apologise if this has already been answered however I couldn't find it anywhere.

    On a daily basis I need to match up two sets of data for employee performance.

    Basically I have a list of all employee numbers and export the results from another piece of software but this only displays the employee's who have results and not all.

    Is there a quick way of matching this data? a function that says if a1 does not = b1 then move b1+c1 down a cell?

    Thanks for your help

  2. #2
    Forum Contributor
    Join Date
    02-15-2005
    Location
    Blackpool, UK
    Posts
    137
    Try this code.

    Public Sub CompareData()
    
        Dim iRow As Integer
    
        ActiveSheet.Range("A1").Select
        
        Do Until ActiveCell.Value = ""
            iRow = ActiveCell.Row
            If Not ActiveSheet.Range("A" & iRow).Value = ActiveSheet.Range("B" & iRow).Value Then
                Range("B" & iRow & ":C" & iRow).Select
                Selection.Insert Shift:=xlDown
                ActiveSheet.Range("A" & iRow + 1).Select
            Else
                ActiveSheet.Range("A" & iRow + 1).Select
            End If
        Loop
    
    End Sub
    ASSUMES: your data starts in cell A1, if not change "ActiveSheet.Range("A1").Select"

    ASSUMES: no breaks in data in Column A, and the code will stop once the first empty cell in Column A is found.

    HTH

    Art

  3. #3
    Registered User
    Join Date
    06-17-2008
    Posts
    7
    Thanks Art, I'll give it a go

+ 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