LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default matching items on 2 sheets

I'm having some problems with the code below. "Range" is
a range name for the items in column A on sheet 2.

I want to look in column A on sheet 1 and if there is a
match in the range (Column A - sheet 2), then I want to
delete the row on Sheet 1 where the match occurs


Sheets("1").Activate

Dim rngToSearch
Dim rngToFind As Range
Dim rngFound As Range

Set rngToSearch = Sheets("2").Range("Range")

For Each rngToFind In rngToSearch

Set rngFound = Sheets("1").Cells.Find(rngToFind.Value)

Do While Not rngFound Is Nothing

rngFound.EntireRow.Delete
Set rngFound = Sheets("1").Cells.Find.
(rngToFind.Value)

Loop

Next rngToFind

Any help would be greatly appreciated. Thanks........
 
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
Matching like items Donna[_2_] Excel Worksheet Functions 2 June 2nd 10 10:03 PM
Formula for non matching items henriques Excel Worksheet Functions 3 April 13th 09 05:53 PM
matching items on a range James Excel Discussion (Misc queries) 1 January 15th 09 01:28 AM
Matching Items Smish Excel Worksheet Functions 3 January 29th 06 04:05 PM
matching items on 2 sheets JT[_2_] Excel Programming 1 February 2nd 05 07:25 PM


All times are GMT +1. The time now is 11:51 PM.

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"