I have two sheets Sheet1 and Sheet2.
In sheet Sheet1, column A is a concatenation of columns B and C.
In sheet Sheet2, again, column A is a concatenation of columns B and C.
For each cell in Sheet2!ColumnA, I want to check if the value exists in Sheet1!ColumnA, and if there is a match I want to retrieve the value from the Column D of the same row from Sheet1.
I tried doing this with the following code:
Sheets("Sheet2").Select
Range("D1").Select
Do
ActiveCell.FormulaR1C1 = "=IF(ISERROR(VLOOKUP(RC[-3],Sheet1!RC[-3]:RC[0],10,FALSE)),0,VLOOKUP(RC[-3],Sheet1!RC[-3]:RC[0],10,FALSE))"
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))
But since this code retrieves the value from the column A of both the sheets as a formula =A2&B2, I am getting the return value as 0.
I tried RC[-3].Value, but got some error.
I am new to excel macro. Can somebody help me fixing this issue. Thanks in advance.
Bookmarks