I am currently using vba to perform the following tasks. So I copied data from sheet1 and pasted it in sheet2. There was already data in sheet2, so I pasted below the existing data. Now I need to perform a vlookup to get data from sheet3 to sheet2 for certain columns, so the vlookup would send the data below the existing data on sheet2. I have the following codes below
Range(“F1”).End(xldown).Offset(1).Select
ActiveCell.FormulaR1C1 = “=Vlookup(RC[7],Monitor_Report[#All],4,FALSE)”
ActiveCell.AutoFill Destination:=Range(ActiveCell.Address & “:” & ActiveCell.End(xlDown).Offset(-1,0).Address)
So currently even tho, the next row has no data, it still auto fills and results in #N/A after the cell where the vlookup occurs first. i do not want the autofill to happen if the next row has no data. Can anyone assist me to modify this code?