Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Need help desperately! To simplify... Sheet1 is made up of two columns: Column A is Last Name Column B is First Name Sheet2 is made up of two columns: Column A is Last Name Column B is First Name I need to write code that will compare Sheet1 Column A to Sheet 2 ColumnA and if there is a match then compare Sheet1 Column B to Sheet 2 Column B to make sure it is the same Last Name and First Name (same row), then write the name next to any matches....and I don't want to concatenate the cells. ![]() My current code is looking for matches not taking into consideration that the Last Name and First Name might not be on the same row for ex. Set CompareRange = Workbooks("Names.xls"). _ Worksheets("Sheet2").Range("B3:B3800,C3:C3800") For Each x In Selection For Each y In CompareRange If x = y Then x.Offset(0, 4) = x Next y Next x If I have Smith Joe in Sheet 1 and in Sheet 2 I have a Smith Bob and a Johnson Joe it will show up as if if found Smith Joe because it isn't putting looking at them together??? I hope that makes sense..... ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank You soooo much Tom!!! It worked perfectly!!! You were right about
my ranges...I was in such a hurry in just trying to simplify my code that I forgot to change that! Thanks a million!! :D :D ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Jim!! I will try that too! :D :D
------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to compare two columns of Names | Excel Discussion (Misc queries) | |||
Excel compare names | Excel Worksheet Functions | |||
Compare names on two worksheets | New Users to Excel | |||
Compare two lists of names | Excel Discussion (Misc queries) | |||
How do I compare two lists of names in excel? | Excel Discussion (Misc queries) |