+ Reply to Thread
Results 1 to 3 of 3

Import file list

  1. #1
    Josh Craig
    Guest

    Import file list

    Hi,

    I want to know if it's possible to import a list of files in a given folder
    to Excel. So, for example, I can have all the files in C:\documents\ listed
    in column A in a worksheet. Is this possible?

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    I created a macro for another guy that wanted to do the same thing. Here it is. Just enter your folder in cell A1 in the format c:\windows\ making sure you put the \ at the end.

    Sub myDIR()
    myFolder = Range("A1").Value
    x = 1
    y = 1
    Range("A2").Select
    Selection = Dir(myFolder)
    Do While y <> ""
    y = Dir
    Selection.Offset(x, 0).Value = y
    x = x + 1
    Loop
    End Sub

  3. #3
    Josh Craig
    Guest

    Re: Import file list

    Cool thanks.

    "Mallycat" wrote:

    >
    > I created a macro for another guy that wanted to do the same thing.
    > Here it is. Just enter your folder in cell A1 in the format
    > c:\windows\ making sure you put the \ at the end.
    >
    > Sub myDIR()
    > myFolder = Range("A1").Value
    > x = 1
    > y = 1
    > Range("A2").Select
    > Selection = Dir(myFolder)
    > Do While y <> ""
    > y = Dir
    > Selection.Offset(x, 0).Value = y
    > x = x + 1
    > Loop
    > End Sub
    >
    >
    > --
    > Mallycat
    > ------------------------------------------------------------------------
    > Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
    > View this thread: http://www.excelforum.com/showthread...hreadid=560970
    >
    >


+ 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