Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've searched on the forum and found ways to list duplicate items and
unique items, but this is for a combination of two lists, not "bumping" one list against another. In this case, I need to compare List A to List B and return those items in List B that are not in List A. I scavenged and tweaked some code, but it is trying to do a cell-to- cell comparison - this won't work as items can be in different locations within the lists. Thoughts? Sub ListDuplicateVal() Dim Rng1 As Range Dim Rng2 As Range Dim Rng3 As Range Dim Cell As Range Set Rng1 = Range("A1:A13") 'long list Set Rng2 = Range("B1:B13") 'short list Set Rng3 = Range("D1") 'output On Error Resume Next For Each Cell In Rng2 If Rng2.Cell.Value < Rng1.Cell.Value Then Rng3.Value = Cell.Value Set Rng3 = Rng3.Offset(1, 0) End If Next Cell End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data validation list - list doesn't show items from top | Excel Discussion (Misc queries) | |||
List and subtotal selected items, then print separate item list | Excel Worksheet Functions | |||
Matching items in 2 list to consolidate to one list | Excel Discussion (Misc queries) | |||
How to count and group items in a list depending on size of list? | Excel Programming | |||
How to count items in a list and group depending on size of list? | Excel Programming |