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

I'm not sure if this involve program or just a function, but here's wha
my situation is.

I have three columns: A,B,C. Column A have 10 records, B have 100, an
C 100. I want to find if the ID in column A will match the ID in colum
C, if it is match, copy the contents in column B to column D. Is ther
any formula that will do this sort of things?

Any suggestion is greatly appreciated!

ljCharli

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find duplicates

PLACE THIS FORMULA INTO COLUNM D

=IF(A1=C1,B1,"")

Once you have placed it into the first Dcell just copy it down for al
values

the cell ref should just change automactly.

What it is say is if the contents of cell a1 are equal to c1 the cop
b1 into d1. If this is not true then leave contents of cell d1 blank.

you should be able to cange this for differ things

ie < is less then
is more then


<= less then or equal
= greater or equal

= eqa

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find duplicates

Many thanks for your help. I see your point; however, the problem i
that cell A only have 10 records and cell B and C have 100 records. I
I do this =IF(A1=C1,B1,"") what happens when column A reaches the cel
11 where 11 to 100 is blank? Here's what I want to do. Find the matc
from column A1 in anywhere on column C1 to C100. With the formula yo
provide, it only finds matching cels up to cell 10.

Any other suggestion is much appreciated.

Charli

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find duplicates

you could have a loop macro run either manually or in worksheet_change

am not really very good with loops so you may need to ask some one bu
this is what the crude code would look like:

You can do long if formula but only up to a certain point
i.e. =IF(A1=C1,B1,IF(A2=C1,B1,IF(A3=C1,B1,"")))
only worked for eight

If Range("A1") = Range("C1") Then GoTo CC Else
If Range("A2") = Range("C1") Then GoTo CC Else
If Range("A3") = Range("C1") Then GoTo CC Else
If Range("A4") = Range("C1") Then GoTo CC Else
If Range("A5") = Range("C1") Then GoTo CC Else
If Range("A6") = Range("C1") Then GoTo CC Else
If Range("A7") = Range("C1") Then GoTo CC Else
If Range("A8") = Range("C1") Then GoTo CC Else
If Range("A9") = Range("C1") Then GoTo CC Else
If Range("A10") = Range("C1") Then GoTo CC Else Exit Sub
CC:
Range("B1").Select
Selection.Copy
Range("D1").Select
ActiveSheet.Paste
Range("A1").Selec

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find duplicates

Many thanks for the help. By the way, is there way to determine th
number of rows so I can use a For loop instead of writing all that? Th
reason is I'm not only doing for 10 or 100...actually my projec
involves 48 thousand records that I need to check for duplicate an
copy the unique ID to column D.

ljCharli

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find duplicates

Okay, here's something I have.....still not working...but perhap
someone else in here might be able to point where it's not working.


Sub Matching()
Dim A As Range, B As Range, C As Range, D As Range
Set C = Range("C2:C10")
Set B = Range("B2:B20")

For i = 2 To C.Rows.Count
For j = 2 To B.Rows.Count
If C.Cells(i, j) = B.Cells(i, j) Then
A.Cells(i, j).Select
Selection.Copy
D.Cells(i, j).Select
ActiveSheet.Paste
End If
Next j
Next i
End Sub


The error is Object variable or With block variable not set.

ljCharli

--
Message posted 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
Find Duplicates rap43 Excel Discussion (Misc queries) 4 October 22nd 09 05:01 PM
Find Duplicates Vic Excel Discussion (Misc queries) 9 August 17th 09 08:36 PM
find duplicates Dylan @ UAFC[_2_] Excel Worksheet Functions 5 December 14th 08 03:00 PM
Find duplicates Daniel - Sydney Excel Discussion (Misc queries) 4 September 27th 07 10:03 PM
Find duplicates R. Choate Excel Discussion (Misc queries) 5 November 28th 04 10:14 PM


All times are GMT +1. The time now is 11:00 AM.

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"