Hi,
I'm trying to compare and list add/deletes between column A in Current Workbook vs. Previous Workbook. I was able to locate some code and modified it and is working well but not exactly what I want.
Any help or guidance is appreciated.
Thank you.
I'm trying to compare and list add/deletes between column A in Current Workbook vs. Previous Workbook. I was able to locate some code and modified it and is working well but not exactly what I want.
- The code below does compare both sheets and and produces a match vs. mismatch message box
- I want to identify what's new (added) between Current Workbook vs. Previous Workbook
- I want to identify what's old (removed) between Current Workbook vs. Previous Workbook
- I want to insert above findings into a new tab on Current Workbook where Column A is adds and Column B is deletes
Code:
Sub WorkbookComparision()
Dim i As Long
Dim wb1ws1, wb2ws2
Dim blnSame As Boolean
wb1ws1 = Workbooks("Current.xlsx").Worksheets("MASTER").Range("A4:A2500").Value
wb2ws2 = Workbooks("Previous.xlsx").Worksheets("MASTER").Range("A4:A2500").Value
For i = LBound(wb1ws1) To UBound(wb1ws1)
If wb1ws1(i, 1) = wb2ws2(i, 1) Then
blnSame = True
Else
blnSame = False
Exit For
End If
Next i
If blnSame = True Then
MsgBox "data is the same"
Else
MsgBox "data is different"
End If
End Sub
Any help or guidance is appreciated.
Thank you.
Last edited by a moderator: