ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to compare two columns of data (https://www.excelbanter.com/excel-discussion-misc-queries/49909-macro-compare-two-columns-data.html)

Odawg

Macro to compare two columns of data
 
Hello All Excel Guru's:

I was wondering if it was possible to have a macro to compare two
columns of data and in the third column only show the ones that are in
Column B and not in Column A and vice versa, In Column A but not in
Column B in Column D

Examle:

Column A Column B Column C Column D

Apple Apple
Bananas Bananas Strawberry
Orange Pear Pear
Grapes Orange Cherry
Strawberry Grapes
Cherry Plums Plums

I have a formula that does this, but I have to copy this formula down
Column C. The
formula that I have is listed below:

formula located in Column C
=IF(B3:B101="","",IF(ISERROR(VLOOKUP(B3,$A$1:$A$20 00,1,FALSE)),B3,""))

formula located in Column D
=IF(A3:A101="","",IF(ISERROR(VLOOKUP(A3,$B$1:$B$20 00,1,FALSE)),A3,""))

Is there anyway to have a macro do the same thing, except that have
all the items in column C and column D sorted together?

Any and all help in this matter is greaty appreciated.

Argus


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com