I am in need of help comparing 2 columns that are stored in 2 worksheets.
I do not need to show what is the same. I need it to only list the differences.
so if there are any matches in column A to Column B then in column C list what is in Column B if there is a Difference list in Column D
I can get part of it to work using VBA Script. But I cannot get it to create Column D with the Difference.
Sub Compare_Match()
Dim CompareRange As Variant, x As Variant, y As Variant
' Set CompareRange equal to the range to which you will
' compare the selection.
Set CompareRange = Range("A2:A5486")
' NOTE: If the compare range is located on another workbook
' or worksheet, use the following syntax.
' Set CompareRange = Workbooks("Book2"). _
' Worksheets("Sheet2").Range("C1:C5")
'
' Loop through each cell in the selection and compare it to
' each cell in CompareRange.
For Each x In Selection
For Each y In CompareRange
If x = y Then x.Offset(0, 3) = x
Next y
Next x
End Sub
Bookmarks