rosspmm
06-30-2005, 09:16 AM
I got this code from this forum fairly recently and i works great :clap:
Sub GetFileList()
Dim iCtr As Integer
With Application.FileSearch
.NewSearch
.LookIn = "N:\DEPT\Projects\DD - Projects by Business Unit\2005\"
.SearchSubFolders = True
.Filename = "*.*"
If .Execute > 0 Then
For iCtr = 1 To .FoundFiles.Count
Cells(iCtr, 1).Value = .FoundFiles(iCtr)
Next iCtr
End If
End With
End Sub
What I now want to do is to be able to specify which element of the directory path should be hidden/ommitted when displayed on screen as the directory path is very long and makes it almost impossible to use the subsequent output.
Any ideas?
would rather I could add it to the above rather than as a separate macro and be able to specify via a message box.
I thought the fileloader.xls responses earlier would help but I cant seem to work out how to make that produce a printed list :doh:
Ross
Sub GetFileList()
Dim iCtr As Integer
With Application.FileSearch
.NewSearch
.LookIn = "N:\DEPT\Projects\DD - Projects by Business Unit\2005\"
.SearchSubFolders = True
.Filename = "*.*"
If .Execute > 0 Then
For iCtr = 1 To .FoundFiles.Count
Cells(iCtr, 1).Value = .FoundFiles(iCtr)
Next iCtr
End If
End With
End Sub
What I now want to do is to be able to specify which element of the directory path should be hidden/ommitted when displayed on screen as the directory path is very long and makes it almost impossible to use the subsequent output.
Any ideas?
would rather I could add it to the above rather than as a separate macro and be able to specify via a message box.
I thought the fileloader.xls responses earlier would help but I cant seem to work out how to make that produce a printed list :doh:
Ross