LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Filter and Delete...... Please

Hi, i have the code below supplied by Tom Ogilvy. What i would like to
do is look up the range 2 and all instances in range 1 delete entire
row, then move one cell down in range 2 compare to range 1 & delete all
rows again etc...

Sub ABC()
Dim sh1 as worksheet, sh2 as worksheet
Dim rng1 as Range, rng2 as Range
Dim rw as Long, cell as Range
set sh1 = worksheets("Tabelle1")
set sh2 = worksheets("Temp")

rw = 2
set rng1 = sh1.Range(sh1.Cells(2,1),sh1.Cells(2,1).End(xldown ))
set rng2 = sh2.Range(sh2.Cells(2,1),sh2.Cells(2,1).End(xldown ))
for each cell in rng1
if application.countif(rng2,cell.value) = 0 then
cell.EntireRow.copy sh3.cells(rw,1)
rw = rw + 1
end if
Next

End sub

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
 
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
filter and delete AND Excel Discussion (Misc queries) 3 March 16th 09 04:27 PM
Filter and Delete lotivbarjoh Excel Worksheet Functions 6 June 30th 08 06:57 PM
AFTER 8 SEC ON SPACEBAR I GOT A FILTER?DELETE IT? Carl Excel Discussion (Misc queries) 2 June 16th 07 02:05 PM
Filter list and delete OfficeNDN Excel Discussion (Misc queries) 4 September 11th 06 04:08 PM
filter and delete Jordan Excel Worksheet Functions 1 July 7th 05 07:18 PM


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