Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Identify duplicate values

I am trying to determine if something can be done. Basically, I have two
spreadsheets and I need to identify duplicate values from the two sheets. If
a unique PIN on sheet A is also found on sheet B, I want to put a "1" in a
column beside that PIN on sheet A so that I can easily eliminate it. I've
done a lot of simple IF statements comparing values in adjacent rows but in
this case, for each PIN on sheet A, it will need to search the entire PIN
column on sheet B, and I can't think how to do this. It's something I would
normally do with a database, but that's not an option here. If someone can
point me in the right direction, I would greatly appreciate it.

Thanks,
Lee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Identify duplicate values


How about:


Code
-------------------
Sub test()

Dim r1 As Range
Dim r2 As Range

For Each r1 In Sheets("SheetA").Range("A1:A1000")
For Each r2 In Sheets("SheetB").Range("A1:A1000")
If r1.Value = r2.Value Then
r1.Offset(0, 1).Value = 1
Exit For
End If
Next
Next

End Su
-------------------


Substituting your sheet names and the ranges for your PINs.



--
kkkni
-----------------------------------------------------------------------
kkknie's Profile: http://www.excelforum.com/member.php...nfo&userid=754
View this thread: http://www.excelforum.com/showthread.php?threadid=26895

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Identify duplicate values

COUNTIF should be able to do it. Assuming the PIN is in column A for both
sheets, then you could put a formula in another column on Sheet A to count if
that PIN appears on sheet B, and if so how many times. So, for example, on
row 1 use this formula where you want your "flag" to go:
=IF(COUNTIF('Sheet B'!A:A,A1)0,1,"")

K Dales

"LA Roper" wrote:

I am trying to determine if something can be done. Basically, I have two
spreadsheets and I need to identify duplicate values from the two sheets. If
a unique PIN on sheet A is also found on sheet B, I want to put a "1" in a
column beside that PIN on sheet A so that I can easily eliminate it. I've
done a lot of simple IF statements comparing values in adjacent rows but in
this case, for each PIN on sheet A, it will need to search the entire PIN
column on sheet B, and I can't think how to do this. It's something I would
normally do with a database, but that's not an option here. If someone can
point me in the right direction, I would greatly appreciate it.

Thanks,
Lee

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
Identify duplicate rows Joe Excel Discussion (Misc queries) 1 October 17th 07 12:25 AM
Need to identify duplicate entries in a Table bman342 Excel Worksheet Functions 6 July 6th 06 09:33 AM
How do I identify duplicate numbers in Excel? Patrick Excel Discussion (Misc queries) 1 February 1st 06 04:40 PM
identify duplicate enteries Debi Excel Worksheet Functions 5 October 13th 05 12:33 AM
Identify and move duplicate rows? ali Excel Programming 11 January 28th 04 06:19 AM


All times are GMT +1. The time now is 10:08 AM.

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

About Us

"It's about Microsoft Excel"