ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   ~Recent File~ (https://www.excelbanter.com/excel-worksheet-functions/6698-%7Erecent-file%7E.html)

andibevan

~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
:confused:


--
andibevan
------------------------------------------------------------------------
andibevan's Profile: http://www.excelforum.com/member.php...fo&userid=9882
View this thread: http://www.excelforum.com/showthread...hreadid=318711


LanceB


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
:confused:


--
andibevan
------------------------------------------------------------------------
andibevan's Profile: http://www.excelforum.com/member.php...fo&userid=9882
View this thread: http://www.excelforum.com/showthread...hreadid=318711



Myrna Larson

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
:confused:




All times are GMT +1. The time now is 02:25 AM.

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