ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UDF for opening most recent file added (https://www.excelbanter.com/excel-programming/342494-udf-opening-most-recent-file-added.html)

jaden41

UDF for opening most recent file added
 

Hey folks,

Im trying to get vlookup to gather data from the most recently adde
file in a folder but so far have come up empty handed. I've trie
embedding the today and text functions in the vlookup code and am no
remotly skilled in VBA.

Is there any method that you folks are aware of, is there a udf ou
there or any other tricks that may work?

Thanks so much in advance :

--
jaden4
-----------------------------------------------------------------------
jaden41's Profile: http://www.excelforum.com/member.php...fo&userid=2801
View this thread: http://www.excelforum.com/showthread.php?threadid=47521


Gary Keramidas

UDF for opening most recent file added
 
not sure what you're looking for, but there is a recentfile object
Application.RecentFiles(2).Open
where the number is the index of the recent file list


--


Gary


"jaden41" wrote in
message ...

Hey folks,

Im trying to get vlookup to gather data from the most recently added
file in a folder but so far have come up empty handed. I've tried
embedding the today and text functions in the vlookup code and am not
remotly skilled in VBA.

Is there any method that you folks are aware of, is there a udf out
there or any other tricks that may work?

Thanks so much in advance :)


--
jaden41
------------------------------------------------------------------------
jaden41's Profile:
http://www.excelforum.com/member.php...o&userid=28015
View this thread: http://www.excelforum.com/showthread...hreadid=475214




jaden41[_2_]

UDF for opening most recent file added
 

Sorry Gary, wasn't as clear as Id like to be there.

What im hoping for is to be able to use vlookup where the table_arra
is the most recently created file in a specific folder.

I do not know how to program in VBA so Im hoping to find a built i
function or a udf that is available that I could use with vlookup.

Thanks again for the hel

--
jaden4
-----------------------------------------------------------------------
jaden41's Profile: http://www.excelforum.com/member.php...fo&userid=2801
View this thread: http://www.excelforum.com/showthread.php?threadid=47521


NickHK

UDF for opening most recent file added
 
jaden41,
Never done this, but I would assume:

1. First you would need to identify the "most recently created file".
Check out the Dir function, looping through all the .xls files in your
folder, either checking the filename against a pattern (if they are named in
some date sensible way) or FileDateTime for the system maintaned info.

2. Once you have the filename, you update all the links with:
ActiveWorkbook.ChangeLink Name:= _
"C:\Documents and Settings\Nick\Desktop\Source.xls",
NewName:="Source2.xls", _
Type:=xlExcelLinks

NickHK

"jaden41" wrote in
message ...

Sorry Gary, wasn't as clear as Id like to be there.

What im hoping for is to be able to use vlookup where the table_array
is the most recently created file in a specific folder.

I do not know how to program in VBA so Im hoping to find a built in
function or a udf that is available that I could use with vlookup.

Thanks again for the help


--
jaden41
------------------------------------------------------------------------
jaden41's Profile:

http://www.excelforum.com/member.php...o&userid=28015
View this thread: http://www.excelforum.com/showthread...hreadid=475214





All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com