Hi Guys,
I have a script where i'm trying to :
(1) lookup column 2 in the "Acct Awaiting 2 week review" worksheet against column 2 in the "MIV Case Details" worksheet and
(2) when it finds a match copy the details from column N in "Acct Awaiting 2 week review" into column N in the "MIV Case Details"
I have the following and according to my message box the data matches but nothing copies ?
Can you help me please ?
I have a script where i'm trying to :
(1) lookup column 2 in the "Acct Awaiting 2 week review" worksheet against column 2 in the "MIV Case Details" worksheet and
(2) when it finds a match copy the details from column N in "Acct Awaiting 2 week review" into column N in the "MIV Case Details"
I have the following and according to my message box the data matches but nothing copies ?
Can you help me please ?
Code:
Private Sub CommandButton1_Click()
Dim i As Long
Dim j As Long
changing_data = Worksheets("Acct Awaiting 2 week review").Range("B" & Rows.count).End(xlUp).Row
to_be_changed_data = Worksheets("MIV Case Details").Range("B" & Rows.count).End(xlUp).Row
For j = 1 To changing_data
For i = 1 To to_be_changed_data
If Worksheets("Acct Awaiting 2 week review").Cells(j, 2).Value = Worksheets("MIV Case Details").Cells(i, 2).Value Then
MsgBox ("Found It")
Worksheets("MIV Case Details").Cells(j, 14).Value = Worksheets("Acct Awaiting 2 week review").Cells(i, 14).Value
Else
End If
Next i
Next j
End Sub