+ Reply to Thread
Results 1 to 2 of 2

To display contents of a folder in an excel sheet using Excel MACRO

  1. #1

    To display contents of a folder in an excel sheet using Excel MACRO

    Hi All,

    i want to display some selected files (starting with a particular text)
    from a folder to an excel sheet.
    please tell me the MACRO code to implement the same.

    Thanks,
    Vishal


  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    Enter your folder path in cell A1

    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

    Matt

+ 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