Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how i dow the following formal in excel | Excel Discussion (Misc queries) | |||
convert formal from excel to access | Excel Worksheet Functions | |||
Conditional Formal not working | Excel Discussion (Misc queries) | |||
Need Help on formal - output a sum | Excel Worksheet Functions | |||
Copy Range with no formal updates | Excel Programming |