LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default List file name only

Excel XP, Win XP
I want get a listing of all the files in a specific folder (ThePath). The
following code does this but the listing includes the path before every file
name. How do I change this code to give only the file names, for instance,
FileName.xls.
Thanks for your time. Otto

Sub GetFileList()
Dim c As Integer
With Application.FileSearch
.NewSearch
.LookIn = ThePath
For c = 1 To .Execute
Dest.Value = .FoundFiles(c)
Set Dest = Dest.Offset(1)
End If
Next c
End With
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear the file open file name dropdown list Daniel.C[_2_] Excel Discussion (Misc queries) 8 October 23rd 08 09:47 AM
File list - list filenames in excel JRP Excel Programming 4 February 19th 07 06:38 PM
ActiveSheet.QueryTables.Add using InputBox and/or a URL list in a .txt file list crazy_vba[_5_] Excel Programming 4 April 29th 06 10:54 PM
The 'Recently used file list' does not show up under the 'File' menu. David F Excel Worksheet Functions 4 June 6th 05 07:43 AM
Convert List box from excel file to VBA list box object baha[_2_] Excel Programming 0 November 22nd 03 05:06 PM


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"