|
Sub xlsファイル出力Dir()
Dim SarchFile As String, Gy As Long
Dim FldNm As String
FldNm = CreateObject("WScript.Shell").SpecialFolders("Desktop")
SarchFile = Dir(FldNm & "\*.xls")
Gy = 0
Do Until SarchFile = ""
Gy = Gy + 1
Cells(Gy, 1).Value = SarchFile
SarchFile = Dir()
Loop
If Gy = 0 Then
MsgBox Dir(FldNm, vbDirectory) & "内にxlsファイルはありませんでした。"
End If
End Sub
Sub getF()
検索フォルダ = CreateObject("WScript.Shell").SpecialFolders("Desktop")
With CreateObject("Scripting.FileSystemObject")
For Each FNM In .GetFolder(検索フォルダ).Files
Ct = Ct + 1
Cells(Ct, 1).Value = FNM.Name
Next
End With
End Sub
|
|