Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey everyone,
I've developed a delightful little macro but have just one littl problem with it. The output is a checklist which contains to lists of values in column and B respectively. The two lists should contain the same value however small differences can sometimes exist. I would like a macro t recognise where these differences occur - is this possible. An example of what imean - List A List B (Col A) (Col B) 1 1 2 2 3 4 4 5 6 6 Can i get a macro to report that value 5 is missing from list A but i list B, and that value 3 is missing from list B but in list A? Can the result be reported in column D? Many many thanks for any help :- -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub CompColumns()
Dim rngA As Range, RngB As Range, Cell As Range Dim rw As Long Set rngA = Range(Cells(1, 1), Cells(1, 1).End(xlDown)) Set RngB = Range(Cells(1, 2), Cells(1, 2).End(xlDown)) Cells(1, 4).Value = "In A, not B" rw = 2 For Each Cell In rngA If Application.CountIf(RngB, Cell.Value) = 0 Then Cells(rw, 4).Value = Cell.Value rw = rw + 1 End If Next Cells(rw, 4).Value = "In B, not A" rw = rw + 1 For Each Cell In RngB If Application.CountIf(rngA, Cell.Value) = 0 Then Cells(rw, 4).Value = Cell.Value rw = rw + 1 End If Next End Sub -- Regards, Tom Ogilvy ali wrote in message ... Hey everyone, I've developed a delightful little macro but have just one little problem with it. The output is a checklist which contains to lists of values in column A and B respectively. The two lists should contain the same values however small differences can sometimes exist. I would like a macro to recognise where these differences occur - is this possible. An example of what imean - List A List B (Col A) (Col B) 1 1 2 2 3 4 4 5 6 6 Can i get a macro to report that value 5 is missing from list A but in list B, and that value 3 is missing from list B but in list A? Can the result be reported in column D? Many many thanks for any help :-) --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Identify Differences Between four columns of data | Excel Discussion (Misc queries) | |||
Highlighting the differences between lists 2 | Excel Discussion (Misc queries) | |||
Highlighting the differences between lists. | Excel Discussion (Misc queries) | |||
Conditional Formating CF (to identify case/strikethro differences) | Excel Worksheet Functions | |||
How can I differences in two Excel Workbook lists automaticall | Excel Discussion (Misc queries) |