Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Matching duplicate entries between two columns

I have one worksheet with several hundred entries in column "A" and over one
thousand items in column "C". I need a procedure which will determine if
each item in the shorter list is also found in the longer list and then paste
the duplicate item in the proper cell in column "B" so I can see which items
are duplicated and which are not.

The closest I can come is the following:

Windows("Deals.xls").Activate
Cells.Find(What:="Spot Buy Settled", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).Select ' Move to cell containing data


Set r1 = ActiveCell ' Copy data in two adjoining cells
Set r2 = ActiveCell.Offset(0, 1)
Set myMultiAreaRange = Union(r1, r2)
myMultiAreaRange.Select
Selection.Copy

Windows("New Deals.xls").Activate
Sheets("Statistics").Select
Cells.Find(What:="Spot Buy Settled", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).PasteSpecial ' Paste data in appropriate cells

This works great for short lists but for longer lists I need to go a step
further.

Thanks,
--
Pops Jackson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Matching duplicate entries between two columns

You could use a formula in your shorter list:

Assumimg data starts in A2, then put this in B2 in shorter list and copy down

=IF(COUNTIF(Sheet2!$A$2:$A$1000,A2)0, "Duplicated","")

Sheet2 contains the longer list

HTH

"Pops Jackson" wrote:

I have one worksheet with several hundred entries in column "A" and over one
thousand items in column "C". I need a procedure which will determine if
each item in the shorter list is also found in the longer list and then paste
the duplicate item in the proper cell in column "B" so I can see which items
are duplicated and which are not.

The closest I can come is the following:

Windows("Deals.xls").Activate
Cells.Find(What:="Spot Buy Settled", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).Select ' Move to cell containing data


Set r1 = ActiveCell ' Copy data in two adjoining cells
Set r2 = ActiveCell.Offset(0, 1)
Set myMultiAreaRange = Union(r1, r2)
myMultiAreaRange.Select
Selection.Copy

Windows("New Deals.xls").Activate
Sheets("Statistics").Select
Cells.Find(What:="Spot Buy Settled", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).PasteSpecial ' Paste data in appropriate cells

This works great for short lists but for longer lists I need to go a step
further.

Thanks,
--
Pops Jackson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Matching duplicate entries between two columns

Thanks, Toppers. This does the job perfectly.
--
Pops Jackson


"Toppers" wrote:

You could use a formula in your shorter list:

Assumimg data starts in A2, then put this in B2 in shorter list and copy down

=IF(COUNTIF(Sheet2!$A$2:$A$1000,A2)0, "Duplicated","")

Sheet2 contains the longer list

HTH

"Pops Jackson" wrote:

I have one worksheet with several hundred entries in column "A" and over one
thousand items in column "C". I need a procedure which will determine if
each item in the shorter list is also found in the longer list and then paste
the duplicate item in the proper cell in column "B" so I can see which items
are duplicated and which are not.

The closest I can come is the following:

Windows("Deals.xls").Activate
Cells.Find(What:="Spot Buy Settled", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).Select ' Move to cell containing data


Set r1 = ActiveCell ' Copy data in two adjoining cells
Set r2 = ActiveCell.Offset(0, 1)
Set myMultiAreaRange = Union(r1, r2)
myMultiAreaRange.Select
Selection.Copy

Windows("New Deals.xls").Activate
Sheets("Statistics").Select
Cells.Find(What:="Spot Buy Settled", After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).PasteSpecial ' Paste data in appropriate cells

This works great for short lists but for longer lists I need to go a step
further.

Thanks,
--
Pops Jackson

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
Marking duplicate entries based on multiple columns Toney Excel Discussion (Misc queries) 5 October 2nd 09 09:27 PM
Indicate Duplicate Entries Across Multiple Columns Cameron Excel Discussion (Misc queries) 6 January 17th 09 12:23 AM
Highlight duplicate entries matching 2 criteria in another workshe RS Excel Worksheet Functions 12 March 15th 07 02:17 PM
Finding duplicate entries with matching lengths, total the quantities, delete the extras RShow Excel Programming 1 October 3rd 05 10:50 AM
Script/function to extract duplicate entries between two columns? Jim Witte Excel Programming 1 January 27th 04 10:05 PM


All times are GMT +1. The time now is 09:18 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"