View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim May
 
Posts: n/a
Default exel list copying

In a new Workbook - Sheet1 run the Standard macro

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

"Marc R Sorger CW" wrote:

How can I print list of exel files names in folder