I would like to copy all the file names from a folder in explorer into Excel.
Is this possible? I am using Window XP and Excel 2003
I would like to copy all the file names from a folder in explorer into Excel.
Is this possible? I am using Window XP and Excel 2003
Ray,
Dim i As Integer
With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = False
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Range("A" & i).Value = .FoundFiles(i)
Next i
End If
End With
HTH,
Bernie
MS Excel MVP
"Ray A" <Ray [email protected]> wrote in message
news:[email protected]...
> I would like to copy all the file names from a folder in explorer into
Excel.
> Is this possible? I am using Window XP and Excel 2003
This is good info but I am not a programmer. Is there an alternative way to
do this. If not in Exel something else maybe?
Al
"Bernie Deitrick" wrote:
> Ray,
>
> Dim i As Integer
> With Application.FileSearch
> .NewSearch
> .LookIn = "C:\Documents and Settings"
> .FileType = msoFileTypeAllFiles
> .SearchSubFolders = False
> If .Execute > 0 Then
> For i = 1 To .FoundFiles.Count
> Range("A" & i).Value = .FoundFiles(i)
> Next i
> End If
> End With
>
> HTH,
> Bernie
> MS Excel MVP
>
>
> "Ray A" <Ray [email protected]> wrote in message
> news:[email protected]...
> > I would like to copy all the file names from a folder in explorer into
> Excel.
> > Is this possible? I am using Window XP and Excel 2003
>
>
>
This is good info but I am not a programmer. Is there an alternative way to
do this. If not in Exel something else maybe?
Al
"Bernie Deitrick" wrote:
> Ray,
>
> Dim i As Integer
> With Application.FileSearch
> .NewSearch
> .LookIn = "C:\Documents and Settings"
> .FileType = msoFileTypeAllFiles
> .SearchSubFolders = False
> If .Execute > 0 Then
> For i = 1 To .FoundFiles.Count
> Range("A" & i).Value = .FoundFiles(i)
> Next i
> End If
> End With
>
> HTH,
> Bernie
> MS Excel MVP
>
>
> "Ray A" <Ray [email protected]> wrote in message
> news:[email protected]...
> > I would like to copy all the file names from a folder in explorer into
> Excel.
> > Is this possible? I am using Window XP and Excel 2003
>
>
>
One method:
click Start, Run and type CMD (to run a DOS window)
type CD\MyFolder
using the path to your folder
something like CD\Documents and Settings\MyFiles
type DIR /-b /w >ListFiles.txt
to copy a list of filenames to a file
type Exit
to close this window
This file (ListFiles.txt) can be opened into Excel.
Hope this helps
--
Originally Posted by Ray A
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks