+ Reply to Thread
Results 1 to 2 of 2

List Filenames from Folder

Hybrid View

  1. #1
    Eskimo
    Guest

    List Filenames from Folder

    Hi,

    I wonder if it's possible to populate a column in excel with filenames that
    come from a folder. I need only to import only the file names and not any of
    the data within the files.

    All the files names that I need end with *.txt

    Thanks,

    Eskimo

  2. #2
    Chip Pearson
    Guest

    Re: List Filenames from Folder

    Try something like

    Dim Rng As Range
    Dim FName As String
    Set Rng = Range("A1")
    FName = Dir("H:\Test\*.txt") '<<< CHANGE PATH
    Do Until FName = ""
    Rng.Value = FName
    Set Rng = Rng(2, 1)
    FName = Dir()
    Loop

    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Eskimo" <Eskimo@discussions.microsoft.com> wrote in message
    news:1CD574C3-DA12-45F4-8B80-FDF8BAC67811@microsoft.com...
    > Hi,
    >
    > I wonder if it's possible to populate a column in excel with
    > filenames that
    > come from a folder. I need only to import only the file names
    > and not any of
    > the data within the files.
    >
    > All the files names that I need end with *.txt
    >
    > Thanks,
    >
    > Eskimo




+ 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