I'm currently setting up a macro that will input a vlookup from another workbook into a sheet, and then copy and paste just the value into another sheet in the first workbook.
Everything works except for:
When I input the actual cell like "A2" it works fine, but this code sequence works in a loop with variables that change the row (nRow).
Any suggestions? Thank you.
Code:
Sheets("CopyPaste").Select
Worksheets("CopyPaste").Cells(9 + (nRow - 9), 17).Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],[VendorQuoteData.xls] Quotes!C1:C5,5)"
Worksheets("CopyPaste").Cells(9 + (nRow - 9), 17).Select
Range(ActiveCell).Copy
Sheets("Sheet").Select
Worksheets("Sheet").Cells((1 + (nRow - 9)), 27).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Everything works except for:
Code:
Range(ActiveCell).Copy
When I input the actual cell like "A2" it works fine, but this code sequence works in a loop with variables that change the row (nRow).
Any suggestions? Thank you.