私はファイルC:\ Users \ fldの全体のパスをインポートしたいが、今日の最近のファイルだけをインポートする。最後に保存したファイルのパスをExcelにインポートするにはどうすればいいですか?
お願いします。パスをインポートする私のVBA以下
:
Sub test()
Dim fso As FileSystemObject
Dim oSourceFolder As Scripting.Folder
Dim oSubFolder As Scripting.Folder
Dim oFile As Scripting.File
Dim oFolder As Scripting.Folder
Dim strFolderName As String
Dim i As Long
Set fso = CreateObject("Scripting.FileSystemObject")
Cells(1, 1).Value = "fld"
strFolderName= "C:\Users\fld"
i = 2
Range("A2").Select
ActiveCell = Range("A2")
Set oSourceFolder = fso.GetFolder(strFolderName)
For Each oFolder In oSourceFolder.SubFolders
For Each oFile In oFolder.Files
Cells(i, 1).Value = Left(oFile.ParentFolder)
i = i + 1
Next oFile
Next oFolder
を)を作成し、スプレッドシートの列Aに書き込みますか? – Dave
私はあなたがここで解決策を見つけることができると信じています:http://stackoverflow.com/questions/17847457/getting-file-last-modified-date-explorer-value-not-cmd-value – Ralph