Hello,
I'm struggeling a bit to figure out how to solve this issue.
I'm trying to compare two data-sets in two different workbooks, where Everything is linked up to an "ID" in column A in "ws" and Column F in "wb1".
I want to check if the value in ws column 4 is the same as the same type of value in wb1, which is in column 42.
Problem is when it finds several occurenses, the code breaks and prints all kinds of wierd outputs, and not just for the "i" in question but for the rest of the returned values.
I'd like for it to print one of each of the mis-matching occurances between the data sets.
Unfortunantly I'm not able to "filter" or remove any copies of the same ID as there might be some different information connected to that ID copy somewhere else in the data-set which is not relevant for this.
The different numbers are:
ID: Is a number, several digits long
The value im trying to match: prices connected to said ID's
Any Ideas?
Thank you for your time.
Regards,
Kasper C
I'm struggeling a bit to figure out how to solve this issue.
I'm trying to compare two data-sets in two different workbooks, where Everything is linked up to an "ID" in column A in "ws" and Column F in "wb1".
I want to check if the value in ws column 4 is the same as the same type of value in wb1, which is in column 42.
Problem is when it finds several occurenses, the code breaks and prints all kinds of wierd outputs, and not just for the "i" in question but for the rest of the returned values.
I'd like for it to print one of each of the mis-matching occurances between the data sets.
Unfortunantly I'm not able to "filter" or remove any copies of the same ID as there might be some different information connected to that ID copy somewhere else in the data-set which is not relevant for this.
The different numbers are:
ID: Is a number, several digits long
The value im trying to match: prices connected to said ID's
Any Ideas?
VBA Code:
Set rng = ws1.Columns("F:F")
For i = 2 To LastRow
finn = ws.Cells(i, 1).Value
Set cell = rng.Find(What:=finn, LookIn:=xlFormulas, LookAt:=xlWhole, MatchCase:=False)
If cell Is Nothing Then
Else
wb1.Activate
cell.Select
p1 = ws.Cells(i, 4).Value
p2 = ws1.Cells(ActiveCell.Row, 42).Value
If Not p1 = p2 Then
LastRowN = wso.Range("A" & Rows.Count).End(xlUp).Row + 1
wso.Range("A" & LastRowN).Value = finn
wso.Range("B" & LastRowN).Value = p1
wso.Range("C" & LastRowN).Value = p2
End If
End If
Next i
Thank you for your time.
Regards,
Kasper C
Last edited by a moderator: