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: 396
Default Help with code needed

Hi all, i was kindly helped with some code to compare and past by Tom
Ogilvy and wouold like to know if it could be used to to compare the two
ranges and delete entire line, if so how would i change it, i have tried
but cannot do it.

Sub ABC()
Dim sh1 as worksheet, sh2 as worksheet, sh3 as worksheet
Dim rng1 as Range, rng2 as Range
Dim rw as Long, cell as Range
set sh1 = worksheets("19_10_06")
set sh2 = worksheets("Oct_06")
set sh3 = worksheets("gAMS")
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
VBA code needed ernie New Users to Excel 1 March 19th 10 12:45 PM
Code Needed John Calder New Users to Excel 10 July 15th 09 11:42 PM
VBA code help needed Martin Excel Discussion (Misc queries) 3 April 28th 06 09:28 AM
Code Fix Needed Phil Hageman[_3_] Excel Programming 2 February 28th 04 01:16 AM
code needed ibo Excel Programming 0 July 29th 03 05:32 PM


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