+ Reply to Thread
Results 1 to 5 of 5

copy & paste

  1. #1
    Ray A
    Guest

    copy & paste

    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

  2. #2
    Bernie Deitrick
    Guest

    Re: copy & paste

    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




  3. #3
    ALLM
    Guest

    Re: copy & paste

    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

    >
    >
    >


  4. #4
    ALLM
    Guest

    Re: copy & paste

    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

    >
    >
    >


  5. #5
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    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

    --

    Quote Originally Posted by Ray A
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1