#1   Report Post  
andibevan
 
Posts: n/a
Default ~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   Report Post  
LanceB
 
Posts: n/a
Default


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   Report Post  
Myrna Larson
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"