Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compare names in two different worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compare names in two different worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compare names in two different worksheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare two columns of Names Sharon Excel Discussion (Misc queries) 5 January 30th 09 11:04 PM
Excel compare names chesjak Excel Worksheet Functions 4 October 27th 08 08:48 AM
Compare names on two worksheets egreen New Users to Excel 1 October 8th 07 07:41 PM
Compare two lists of names ea Excel Discussion (Misc queries) 1 December 22nd 05 01:31 AM
How do I compare two lists of names in excel? Jack the Cate Excel Discussion (Misc queries) 1 December 24th 04 12:07 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"