+ Reply to Thread
Results 1 to 3 of 3

Thread: List Selected Files

  1. #1
    Registered User
    Join Date
    10-13-2009
    Location
    Great Falls, Montana
    MS-Off Ver
    Excel 2007
    Posts
    23

    List Selected Files

    I am trying to use Application.GetOpenFilename to search for a several (.jpg) files and list the file paths on a worksheet. I found this on another post that works wonderful if only one file is chosen.

    Sub findfile()
    
    Dim FLName As String
    
    FLName = Application.GetOpenFilename
    Range("a1").Value = FLName
    End Sub
    I would like to make multiple file selections and list them in a worksheet row. Can anybody please help?

    Thank you,
    Frank
    Last edited by Frankf; 02-13-2010 at 02:16 PM. Reason: it is solved

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: List Selected Files

    This will keep looping until you Cancel.
    Sub ListFile()
    Dim FLName As String
    
    Do
        FLName = Application.GetOpenFilename
        If FLName = "False" Then Exit Sub
        Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = FLName
    Loop
    
    End Sub
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-13-2009
    Location
    Great Falls, Montana
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: List Selected Files

    Thanks so much for your help. That works like a charm !

+ 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.2.0