Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filename from the result of a Filesearch
When I request Application.FileSearch.filename i get the name of th 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 get only the name of the file?? -- pauloreis ----------------------------------------------------------------------- pauloreiss's Profile: http://www.excelforum.com/member.php...fo&userid=2982 View this thread: http://www.excelforum.com/showthread.php?threadid=49790 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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" wrote in message ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
FileSearch FileName using wildcard (?) | Excel Programming | |||
vlookup and filename returning same result on each sheet. | Excel Discussion (Misc queries) | |||
Saving filename same as import filename | Excel Programming | |||
FileSearch gives unexpected result | Excel Programming |