Hi All,
Recently MD and xld helped me to gather Vlookup data from an unopened file by linking the data to my active workbook (see code below)
Private Sub AddVlookUp()
Const FILEPATH As String = _
"C:\Documents and Settings\francri\My Documents\Motorola\" & _
"Billibg Reports\Timesheet Consolidation 19 May 2008\"
Dim i As Long
Dim k As Long
Dim LastRow As Long
With Sheets("Vlookup")
For i = 1 To 3
For k = 1 To 125
.Cells(k, i).FormulaR1C1 = "='" & FILEPATH & _
"[Confirmation Required Final.xls]Vlookup Data'!R" & k & "C" & i
Next
Next
End With
I now have a slightly different query;
For another project, I would like to gather Vlookup data from multiple unopened files, so;
1) I will create a sheet called Vlookup in my active workbook (the one I have open and where the macro will be run)
2) I will create a FILEPATH as in the code above
3) Then I need to say for each workbook (*.xls) in the directory (FILEPATH) get data from Approved Timesheets (this will always be the sheet name containing the data I need) I will need the data to include only 3 columns, Column 2, 49, 50 (but all rows down to last row of data)
4) Link this data to my activeworskeet (Vlookup) then continue to next workbook in FILEPATH capture sames range of data and link to next blank row in Vlookup
5) I then need the vlookup formula to interrogate 2 pieces of data, If data from Column 3 is found then find out if data in column 49 is found, if yes to both then return value of column 50
I hope this makes sense.
Can anyone help.
Thanks,
Marshybid