abhaysanan
Board Regular
- Joined
- Jun 1, 2005
- Messages
- 95
I'm trying to do a vlookup with vba where my lookup value changes per row.
The value I want to lookup is in column 6 of every row. I need to look up that value from another sheet and Insert it into another column in the same row. I cant seem to make my look up value correspond to te current row though. This is pretty simple I guess but I just cant figure out the syntax. Thanks!
Code:
For j = row To i
If ActiveSheet.Cells(j, 5) = "USD" And Sheets("TempExtract").Cells(1, 8) = "USD" Then
ActiveSheet.Cells(j, col).Formula = "=VLOOKUP(Cells(j,6),TempExtract!A:M,7,FALSE)"
ActiveSheet.Cells(j, col).Copy
ActiveSheet.Cells(j, col).PasteSpecial xlPasteValues
End If
Next j
The value I want to lookup is in column 6 of every row. I need to look up that value from another sheet and Insert it into another column in the same row. I cant seem to make my look up value correspond to te current row though. This is pretty simple I guess but I just cant figure out the syntax. Thanks!