LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default compare two worksheets and delete rows


Not to usurp any credit from Tom, nor to "show him up", but this ma
work.

Replace
If sh1.Cells(i, "A").Value = sh2.Cells(i, "A").Value Then

with
If sh1.Cells(i, "A").Value = Cells.Find(sh1.Cells(i, "A").Value
ActiveCell, xlFormulas, xlWhole, xlByColumns, xlPrevious, False, False
Then

This should search the entire sheet2 to find the value on sheet

--
bgeie
-----------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...fo&userid=1282
View this thread: http://www.excelforum.com/showthread.php?threadid=54599



 
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
Compare Rows and delete duplicate records Dizzlews Excel Worksheet Functions 3 August 12th 08 11:16 PM
Help! -How to compare two worksheets; multiple rows of data=result EricZ Excel Worksheet Functions 1 March 26th 08 07:09 PM
Compare 1st 8 digits of rows in three worksheets NeedExcelHelp07 Excel Worksheet Functions 0 January 30th 08 08:47 PM
Add or Delete Rows in Protected worksheets NH Excel Discussion (Misc queries) 0 March 16th 06 05:15 PM
Using VBA to delete certain worksheets rows avilla Excel Programming 1 September 7th 04 04:34 PM


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