2012-07-13 19 views
1

真的很簡單的問題,我想。我怎樣才能修改下面的內容,而不是看LOI.CSV,它會查看Intraday文件夾中的所有.CSV文件?檢查文件夾中所有CSV文件的上次保存日期

LastSaved = FileDateTime("W:\Settlements\Intraday\LOT.csv") 

If LastSaved < Date Then 
    MsgBox ("The current day file for LOI was last saved " & LastSaved) 
End If 

回答

3

試試這個

Const sPath As String = "W:\Settlements\Intraday\" 

Sub LoopThroughFilesInAFolder() 
    Dim StrFile As String 

    StrFile = Dir(sPath & "\*.Csv") 

    Do While Len(StrFile) > 0 
     Debug.Print FileDateTime(sPath & "\" & StrFile) 
     '~~> Rest of the code here 
     StrFile = Dir 
    Loop 
End Sub 
+0

那票......非常感謝,我在工作類似的東西,但錯過了*了。 – user1523568 2012-07-13 13:47:13

相關問題