+ Reply to Thread
Results 1 to 2 of 2

Filename from the result of a Filesearch

  1. #1
    Registered User
    Join Date
    12-21-2005
    Posts
    12

    Question Filename from the result of a Filesearch

    When I request Application.FileSearch.filename i get the name of the file i searched. In my case "*.xls".
    I would like to get the name of the file that the search found.
    The Application.FileSearch.foundfiles gives me the full path. How do i get only the name of the file???

  2. #2
    Bernie Deitrick
    Guest

    Re: Filename from the result of a Filesearch

    Paulo,

    With Application.FileSearch
    ..NewSearch
    ..LookIn = "C:\Documents and Settings"
    ..Filename = "*.xls"
    If .Execute > 0 Then
    For i = 1 To .FoundFiles.Count
    MsgBox Mid(.FoundFiles(i), InStrRev(.FoundFiles(i), "\") + 1, _
    Len(.FoundFiles(i)))
    Next i
    End If
    End With

    HTH,
    Bernie
    MS Excel MVP


    "pauloreiss" <[email protected]> wrote in message
    news:[email protected]...
    >
    > When I request Application.FileSearch.filename i get the name of the
    > file i searched. In my case "*.xls".
    > I would like to get the name of the file that the search found.
    > The Application.FileSearch.foundfiles gives me the full path. How do i
    > get only the name of the file???
    >
    >
    > --
    > pauloreiss
    > ------------------------------------------------------------------------
    > pauloreiss's Profile: http://www.excelforum.com/member.php...o&userid=29820
    > View this thread: http://www.excelforum.com/showthread...hreadid=497901
    >




+ 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