close

How can I print list of exel files names in folder

In a new Workbook - Sheet1 run the Standard macro

Sub listthefiles()
Cells.ClearContents
Range(quot;A1quot;).Select
Set fs = Application.FileSearch
With fs
..LookIn = quot;C:\JMay\MyStuff\quot;
..Filename = quot;*.xlsquot;
If .Execute gt; 0 Then
For I = 1 To .FoundFiles.Count
ActiveCell.FormulaR1C1 = .FoundFiles(I)
ActiveCell.Offset(0, 1).Range(quot;A1quot;).Select
ActiveCell.FormulaR1C1 = quot;=RIGHT(RC[-1],LEN(RC[-1])-45)quot;
ActiveCell.Value = ActiveCell.Value
ActiveCell.Offset(1, -1).Select
Next I
Else
End If
End With
Range(quot;A:Aquot;).Delete
Range(quot;A1quot;).Select
End Sub

quot;Marc R Sorger CWquot; wrote:

gt; How can I print list of exel files names in folder

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()