I
ianripping
I HAVE THIS:
Sub ListfilesInDirectory()
Dim direc
direc = Range("ad2")
Sheets("Macro").Select
Range("a1").Select
Set fs = Application.FileSearch
With fs
.LookIn = direc
.FileName = "*.xls"
If .Execute > 0 Then
ActiveCell = Range("A1")
For I = 1 To .FoundFiles.Count
ActiveCell.FormulaR1C1 = .FoundFiles(I)
ActiveCell.Offset(1, 0).Select
Next I
Else
End If
End With
Could it be made so that the cells display the filename, instead of th
filename and its directory
Sub ListfilesInDirectory()
Dim direc
direc = Range("ad2")
Sheets("Macro").Select
Range("a1").Select
Set fs = Application.FileSearch
With fs
.LookIn = direc
.FileName = "*.xls"
If .Execute > 0 Then
ActiveCell = Range("A1")
For I = 1 To .FoundFiles.Count
ActiveCell.FormulaR1C1 = .FoundFiles(I)
ActiveCell.Offset(1, 0).Select
Next I
Else
End If
End With
Could it be made so that the cells display the filename, instead of th
filename and its directory