+ Reply to Thread
Results 1 to 4 of 4

Matching two lists?

  1. #1
    Registered User
    Join Date
    09-06-2006
    Posts
    10

    Matching two lists?

    Hi guys... I've got a little problem I'm stuck on.

    I have 2 lists of numbers, and want to write a macro that will do the following:

    1) Select first number from list 1
    2) Find the *exact* same number in list 2
    3) highlight the number in list 2
    4) move on to the next number on list 1 and repeat.

    I'm comfortable in doing the offset and colouring stuff, I just don't know how to search for a variable and find an exact match.

    Can anyone help?

  2. #2
    Forum Contributor
    Join Date
    01-13-2006
    Location
    Texas
    Posts
    161
    Dim List1, List2, ValueFound as Range

    For each c in List1
    With Range ("List2")
    Set ValueFound = .Find(c.value)
    If ValueFound is Nothing Then
    MsgBox ("List 1 Value not found in List 2")
    Else
    Do your highlighting, coloring, etc
    End If
    End With
    Next c

  3. #3
    Registered User
    Join Date
    09-06-2006
    Posts
    10
    I managed to find a way of doing it, but thanks. It's always good finding different ways, all part of the learning!

    Cheers Conor!

  4. #4
    Registered User
    Join Date
    02-02-2007
    Posts
    4
    If all nos. in list are unique
    name both columns as array1
    in first cell conditional format put
    =countif(array1,first cell)>1
    and do your formatting as usual

    this will format all non-unique values

+ 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