Computing.Net > Forums > Office Software > Excel: find matching names

Excel: find matching names

Reply to Message Icon

Original Message
Name: Stas Neyman
Date: April 24, 2007 at 12:55:09 Pacific
Subject: Excel: find matching names
OS: XP Professional
CPU/Ram: Intel, 1Gb
Model/Manufacturer: Lenovo, T60
Comment:

Hello. I am in dire need of your help.
I am trying to reconcile two columns with names. I need to find out if names in coulmn B appear in Column A.

Here is an example

A B
Stas Neyman - Director Neyman
Will Smith, Assistant Beams
Jim Dangle, Officer Smith

As you can see, the first column contains names and titles. The second column contains only last names. The goal is to find out if any last names from coulmn B appear in anywhere in Column A.

(Imagine list of users to an application, that needs to be checked agains list of users who have been terminated)

Thank you!


Report Offensive Message For Removal

Response Number 1
Name: Bryco
Date: April 24, 2007 at 14:58:16 Pacific
Subject: Excel: find matching names
Reply: (edit)

Are you saying:
A********************B
Stas Neyman - Director----Neyman
Will Smith, Assistant--------Beams
Jim Dangle, Officer---------Smith
The single name is in column B and you want your function to find the single name shown in column B within the text of Column A?

Bryan



Report Offensive Follow Up For Removal

Response Number 2
Name: DerbyDad03
Date: April 25, 2007 at 12:29:05 Pacific
Subject: Excel: find matching names
Reply: (edit)

You don't say what you want to do if a name in Column B is found in Column A, but this code will turn the Column B cell yellow if the name is found (at least once) in Column A.

Sub NameFinder()
Last_B_Row = Range("B65536").End(xlUp).Row
For Each Last_Name In Range("B1:B" & Last_B_Row)
With Worksheets(1).Range("A:A")
Set c = .Find(Last_Name, lookat:=xlPart)
If Not c Is Nothing Then
Last_Name.Interior.ColorIndex = 6
End If
End With
Next
End Sub



Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Excel: find matching names

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software