LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default how to get DateLastModified name with wildcard

I use code below to find the latest modified file in a directory. How can
can do that same thing an also set criteria to look for latest file modified
beginning with "aaa*" . . . how to get newest "C:\Lee\" & "aaa*"

Dim fNewest
Set oFolder = CreateObject("scripting.filesystemobject").getfold er("C:\Lee\")
For Each aFile In oFolder.Files
If fNewest = "" Then
Set fNewest = aFile
Else
If fNewest.DateLastModified < aFile.DateLastModified Then
Set fNewest = aFile
End If
End If
Next
MsgBox fNewest.Name

--
Thanks & Best Regards
 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Use DateLastModified Property in VBA? HROBERTSON Excel Discussion (Misc queries) 3 May 6th 23 03:45 AM
wildcard JOUIOUI Excel Programming 5 July 31st 06 01:47 PM
Wildcard fugfug[_10_] Excel Programming 0 July 14th 05 12:34 PM
DateLastModified nina Excel Worksheet Functions 2 March 21st 05 02:11 PM
DateLastModified property date extraction Nigel[_6_] Excel Programming 6 November 15th 03 06:21 PM


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

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

About Us

"It's about Microsoft Excel"