I am trying to lookup the value in column I, in worksheet "QA Hold", and paste the value from the lookup table in worksheet “Master Part Numbers” A2:B1000, column B, and paste in column J in worksheet “QA Hold”.
If I were doing a formula, it would look like this: =VLOOKUP(I2,'Master Part Numbers'!A:B,2,FALSE)
I want to do this without the formula, just code, and I would like to start pasting in J2 and loop.
I have the following code, but it returns “#NAME?”. Can you please assist? Hoping I am not too far off.
Sub VlookupPartDesc()
Dim lLastRow As Long
With Sheets("QA Hold")
lLastRow = .Cells(.Rows.Count, "I").End(xlUp).Row
With .Range("J2:J" & lLastRow)
.FormulaR1C1 = "=VLOOKUP(I2,'Master Part Numbers'!A2:B1000,2,FALSE)"
.Value = .Value
End With
End With
End Sub
If I were doing a formula, it would look like this: =VLOOKUP(I2,'Master Part Numbers'!A:B,2,FALSE)
I want to do this without the formula, just code, and I would like to start pasting in J2 and loop.
I have the following code, but it returns “#NAME?”. Can you please assist? Hoping I am not too far off.
Sub VlookupPartDesc()
Dim lLastRow As Long
With Sheets("QA Hold")
lLastRow = .Cells(.Rows.Count, "I").End(xlUp).Row
With .Range("J2:J" & lLastRow)
.FormulaR1C1 = "=VLOOKUP(I2,'Master Part Numbers'!A2:B1000,2,FALSE)"
.Value = .Value
End With
End With
End Sub