View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Kilmer[_2_] Bob Kilmer[_2_] is offline
external usenet poster
 
Posts: 71
Default Is there a smart way to select multiple rows based on column...

"Mike" wrote in message
...
The usual scenario i'm afraid... not that i haven't done it, but just got

a feeling it can be more efficiently done... thanks for bearing with me :)

I have 2 sheets to compare... "Sheet1" has unique IDs in column "A", as

does "Sheet2". The IDs are only listed once on Sheet1, but can appear on
many rows in Sheet2. I have written a loop to cycle through the IDs in
Sheet1 - on each loop, it runs down the whole list of IDs in Sheet2, and
deletes any rows that match. At the end, it increments to the next ID on
Sheet1. This works fine, but can be a very slow process with long lists on
Sheet2...

I wonder if it is possible to use a SpecialCells / other technique to

mass-select the rows on Sheet2 matching the ID, and delete these en-masse,
then continue to next ID... The compiled processes run much faster...
If anyone can suggest if this is possible, or suggest a starting point, I

would appreciate it.

Many thanks.

Mike


One idea:
Using each ID in sheet1, Replace All corresponding IDs in sheet2 with
nothing, then, when finished going thru the IDs in sheet1, select and delete
entire rows in sheet2 using SpecialCells and the blank cells in the ID
column .

Bob Kilmer