Vlookup in another Excel file
Solved
Kuartz
Posted messages
852
Registration date
Status
Member
Last intervention
-
f894009 Posted messages 17417 Registration date Status Member Last intervention -
f894009 Posted messages 17417 Registration date Status Member Last intervention -
Hello,
Here is my macro:
End Sub
Excel tells me: "The index does not belong to the selection" and highlights:
Any idea?
Thank you in advance.
Best regards.
Here is my macro:
Sub CONTACT() Dim i As Long Dim DL As Long DL = ThisWorkbook.ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To DL ThisWorkbook.ActiveSheet.Cells(i, 14) = Application.VLookup(ThisWorkbook.ActiveSheet.Cells(i, 1).Value, Workbooks("K:\AFFRETEMENT EN COURS\2015\SEPTEMBRE 2015\affretement SEPTEMBRE 2015.xls").Sheets(1).Range("T:W"), 1, False) Next i End Sub
Excel tells me: "The index does not belong to the selection" and highlights:
ThisWorkbook.ActiveSheet.Cells(i, 14) = Application.VLookup(ThisWorkbook.ActiveSheet.Cells(i, 1).Value, Workbooks("K:\AFFRETEMENT EN COURS\2015\SEPTEMBRE 2015\affretement SEPTEMBRE 2015.xls").Sheets(1).Range("T:W"), 1, False) Any idea?
Thank you in advance.
Best regards.