finding different items and correct based on column
hi
I have two sheets (complete,error)should match column B between two sheets based on column A if I find any error or missed items in column B into sheet2 then should correct based on sheet1 after match between columns B based on column A and show the error or missed items in column C as I put the expected result insheet correction .
thanks in advance
According to your attachment a VBA demonstration for starters :
PHP Code:
Sub Demo1() Dim V, W, X, Y, R&, Z, S With Sheets("complete").UsedRange.Columns V = .Item(1).Value2 W = .Item(2).Value2 End With With Sheets("missed").UsedRange.Columns("B:C") .Item(2).Rows("2:" & .Rows.Count).ClearContents X = .Item(0).Value2 Y = .Value2 For R = 2 To .Rows.Count Z = Application.Match(X(R, 1), V, 0) If IsNumeric(Z) Then If W(Z, 1) <> Y(R, 1) Then Y(R, 2) = Split(W(Z, 1)) For Each S In Split(Y(R, 1)) Y(R, 1) = Application.Match(S, Y(R, 2), 0) If IsNumeric(Y(R, 1)) Then Y(R, 2)(Y(R, 1) - 1) = False Next Y(R, 1) = W(Z, 1) Y(R, 2) = Join(Filter(Y(R, 2), False, False)) End If End If Next .Value2 = Y End With End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Re: finding different items and correct based on column
great! last thing and I'm really sorry add new requirement if you can do it I truly appreciate .
I would add another column to show also the error when the run the macro
you can see the data before and after .
Bookmarks