Hi,
im trying to amend an existing code to find the text "#N/A" in column L then go for the Vlookup.
while doing so im getting the Method 'Range' of object_Global failed error.
please see below the code
any suggestion will be highly appreciated.
thanks,
Aleem
im trying to amend an existing code to find the text "#N/A" in column L then go for the Vlookup.
while doing so im getting the Method 'Range' of object_Global failed error.
please see below the code
VBA Code:
With ws1
lLastRow = .Cells(.Rows.Count, 2).End(xlUp).Row
arr = .Range("A2:M" & lLastRow)
For i = LBound(arr) To UBound(arr)
If Range(arr(i, 12)).Text = "#N/A" Then
If Len(arr(i, 1)) > 0 Then
arr(i, 13) = Application.VLookup(arr(i, 1), ws3.Range("A:C"), 3, False)
End If
End If
Next
.Range("M1:M" & lLastRow) = Application.Index(arr, 0, 13)
End With
any suggestion will be highly appreciated.
thanks,
Aleem