Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Listing files in directories.

Hi All.
I have this below coding to list all files in a directory.
However i need to modify the code to modify the code to
display the folder path along with the file name.
If possible as well, i need to modify the coding to also
list files located in sub-directories as well.
Any help would be greatly appreciated.
Cheers.
Skmr3.

Sub DisplayFilesInDirectory()
Dim fs, f, f1, fc, s
Dim Folder
Folder = "???"
Set fs = CreateObject("scripting.filesystemobject")
Set f = fs.GetFolder(Folder)
Set fc = f.Files
For Each f1 In fc
ActiveCell.Value = s & f1.Name
ActiveCell.Offset(1, 0).Activate
Next

End Sub
Reply
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
Stop Excel from locking files/directories you AREN'T working on? Your Display Name here... Excel Discussion (Misc queries) 1 November 20th 09 01:14 AM
Listing of excel files in My Documents bankerlady Excel Discussion (Misc queries) 0 May 21st 08 01:13 AM
LIsting Files in Excel Sudhir Amin[_2_] Excel Discussion (Misc queries) 1 January 17th 08 02:56 PM
Periodically listing files in a folder haven104 Excel Discussion (Misc queries) 2 January 10th 06 09:01 AM
How do I get excel files to open automatically from directories? Damian Excel Discussion (Misc queries) 2 January 3rd 06 02:51 PM


All times are GMT +1. The time now is 05:16 PM.

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

About Us

"It's about Microsoft Excel"