Consulting

Results 1 to 5 of 5

Thread: List of files in a folder and sub folder

  1. #1

    List of files in a folder and sub folder

    Hi,

    How to create list of files in a folder/sub folder. I just want the file names only. I don't need any file attributes.

    I found a article in kb but it doesn't help me. I am using excel 2007.

    Thanks in advance,

    krrish

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Explain in what way it doesn't help.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Sorry xld,

    I got the right link here:

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=1042
    by the way can any one explain this steps.

    If .SelectedItems.Count <> 0 Then 
                xDirect$ = .SelectedItems(1) & "\" 
                xFname$ = Dir(xDirect$, 7) 
                Do While xFname$ <> "" 
                    ActiveCell.Offset(xRow) = xFname$ 
                    xRow = xRow + 1 
                    xFname$ = Dir

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It takes the first of the folder names selected and loops through processing every file in that older.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Quote Originally Posted by xld
    It takes the first of the folder names selected and loops through processing every file in that older.
    hey sorry to bugging you,

    Dir(xDirect$, 7)
    In this code, what is mean by 7?

Posting Permissions

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