Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Formal to compare a list

Is this what you want?

Sub CompareLists()

Set rnga = Range("List1") ' Contains first list of account numbers
Set rngb = Range("List2") ' Contains second list of account numbers

Set wsin = Worksheets("sheet1") ' input data i.e. contains rows to be copied
Set wsout = Worksheets("sheet2") ' output data (third list)

rw1 = 1
For Each cell In rnga
If Not IsError(Application.Match(cell.Value, rngb, 0)) Then ' matched ....
wsin.Range("A" & cell.Row).EntireRow.Copy Destination:=wsout.Range("A" &
rw1)
rw1 = rw1 + 1
End If
Next

End Sub


[Assume wsin contains one of your account lists].

HTH

"Ange" wrote:

hello all,

I need a formula to compare account numbers in two lists, then to
create a third based on what account numbers match.

The whole row (other fields) need to be brought to the third list as
well.

Thanks you

Reply
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
how i dow the following formal in excel FROM SA[_2_] Excel Discussion (Misc queries) 7 March 16th 09 07:23 PM
convert formal from excel to access FROM SA[_2_] Excel Worksheet Functions 1 March 13th 09 10:07 AM
Conditional Formal not working mailrail Excel Discussion (Misc queries) 4 November 7th 08 11:06 PM
Need Help on formal - output a sum Deiow Excel Worksheet Functions 3 July 26th 08 05:59 AM
Copy Range with no formal updates [email protected] Excel Programming 1 September 23rd 03 11:18 PM


All times are GMT +1. The time now is 12:39 AM.

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"