Home |
Search |
Today's Posts |
#1
|
|||
|
|||
~Recent File~
Hi All, Is there a formula which can be used to display the name of the most recently editted file in a specific directory. I have a macro which does this but need to try and find a formula to use? Any ideas? Thanks Andi -- andibevan ------------------------------------------------------------------------ andibevan's Profile: http://www.excelforum.com/member.php...fo&userid=9882 View this thread: http://www.excelforum.com/showthread...hreadid=318711 |
#2
|
|||
|
|||
You can create a user defined function, as an example: Function findit() Dim a As Date Dim b As Variant With Application.FileSearch If .Execute() 0 Then For i = 1 To .FoundFiles.Count If a < FileDateTime(.FoundFiles(i)) Then a = FileDateTime(.FoundFiles(i)) b = .FoundFiles(i) End If Next i findit = b End If End With End Function Placing =findit() in a cell will return the name of the file with the most current date "andibevan" wrote: Hi All, Is there a formula which can be used to display the name of the most recently editted file in a specific directory. I have a macro which does this but need to try and find a formula to use? Any ideas? Thanks Andi -- andibevan ------------------------------------------------------------------------ andibevan's Profile: http://www.excelforum.com/member.php...fo&userid=9882 View this thread: http://www.excelforum.com/showthread...hreadid=318711 |
#3
|
|||
|
|||
If by "macro" you mean a VBA function, that is the only way. AFAIK, there are
no regular Excel worksheet functions that even read files names from a directory, to say nothing of the the date & time modified. There is, of course, an old XLM macro function that will retrieve the file names, but not the times. On Fri, 19 Nov 2004 06:25:32 -0600, andibevan wrote: Hi All, Is there a formula which can be used to display the name of the most recently editted file in a specific directory. I have a macro which does this but need to try and find a formula to use? Any ideas? Thanks Andi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|