I don't have a precise row for the fill down and it does change from one workbook to another. So fill down until the last non empty row. is that possible ? it's like the auto-fill tool that we can use when we click on the bottom left of the cell.
yes plausible but still need some relative guide on where to stop otherwise....1048576 rows will get filled...
last row in column A? B?C? or just last used range/row on the sheet?
i will assume match column A
then code
Sub Insert_Vlookup()
'
Dim wb As Workbook
Workbooks.Open Filename:="C:\Users\vthang\Downloads\Vlookup.xlsx"
For Each wb In Workbooks
If wb.Name <> "PERSONAL.XLSB" Then
If wb.Name <> "Vlookup.xlsx" Then
wb.Activate
Range("C2").Formula = "=VLOOKUP(A2,'[vlookup.xlsx]Sheet1'!$A:$C,3,0)"
Range(Cells(2, 3), Cells(Cells(Rows.Count, "A").End(xlUp).Row, 3)).FillDown
End If
End If
Next wb
End Sub
Bookmarks