Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding records that do not match (XP; SR3)

    While surfing the net I found code that compares two columns and finds matching values. The code could also be applied to text in the columns.

    Is it possible to find non-matching values? I realize that Column B lists those values that are matched and leaves the non-matched ones blank. I'm interested in listing only those values that do not match in Column B.

    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Finding records that do not match (XP; SR3)

    Try this:

    Sub Find_NonMatches()
    Dim CompareRange As Range, x As Range
    Set CompareRange = Range("C1:C5")
    For Each x In Selection
    If CompareRange.Find(What:=x.Value, LookIn:=xlValues, LookAt:=xlWhole) Is Nothing Then
    x.Offset(0, 1) = x
    End If
    Next x
    End Sub

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding records that do not match (XP; SR3)

    Hans,

    Thanks,

    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •