Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Compare identifier columns from 2 sheets - remove rows that are dups

I have two sheets with thousands of rows. I need to remove rows from the 2nd
sheet that have the same identifier as rows in the first sheet... so there are
no duplicates.

Example...

'Sheet1'

ddd1234 <several data columns
ddd1234 <several data columns
abc1234 <several data columns
wrd1234 <several data columns
wrd1234 <several data columns



'Sheet2'

ddd1234 <several data columns
abc1234 <several data columns
wrd1234 <several data columns
www1234 <several data columns
ggg1234 <several data columns


.... yes, Sheet1 may have multiple rows with the same identifier but that does
not matter... I just want to remove rows from Sheet2 anything that matches IDs
from Sheet1 - I don't care about consolidating or removing dups from Sheet1.

thx for the help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Compare identifier columns from 2 sheets - remove rows that are dups

I need this to be a Macro (VBA)... thx!
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 587
Default Compare identifier columns from 2 sheets - remove rows that aredups

hi Livin,

Sub test()
With Sheets("Sheet2")
For i = .Range("A65536").End(xlUp).Row To 1 Step -1
If Not IsError(Application.Match(.Range("A" & i), Sheets("Sheet1").Range("A:A"), 0)) Then
.Rows(i).Delete Shift:=xlUp
End If
Next
End With
End Sub

--
isabelle



Le 2012-05-04 19:35, Livin a écrit :
I have two sheets with thousands of rows. I need to remove rows from the 2nd
sheet that have the same identifier as rows in the first sheet... so there are
no duplicates.

Example...

'Sheet1'

ddd1234<several data columns
ddd1234<several data columns
abc1234<several data columns
wrd1234<several data columns
wrd1234<several data columns



'Sheet2'

ddd1234<several data columns
abc1234<several data columns
wrd1234<several data columns
www1234<several data columns
ggg1234<several data columns


... yes, Sheet1 may have multiple rows with the same identifier but that does
not matter... I just want to remove rows from Sheet2 anything that matches IDs
from Sheet1 - I don't care about consolidating or removing dups from Sheet1.

thx for the help!

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 append and remove dups TG Excel Programming 1 July 18th 08 09:07 PM
Compare dates and unique identifier vg09 Excel Discussion (Misc queries) 1 May 23rd 08 09:34 AM
"Add/Remove Rows Code" adds rows on grouped sheets, but won't remove rows. Conan Kelly Excel Programming 1 November 16th 07 10:41 PM
Compare columns remove duplicates Tommy Geek Excel Discussion (Misc queries) 1 December 21st 06 06:42 PM
Macro that will hidden columns, rows and worksheets based on an identifier [email protected] Excel Discussion (Misc queries) 2 November 27th 06 03:49 PM


All times are GMT +1. The time now is 03:27 PM.

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"