LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Don is offline
external usenet poster
 
Posts: 487
Default "Listing Contents of Sub-Folders"

Here's a snippit of code (attached to a userform) that I use to list files
contained in a folder. This code only picks up files contained in the folder
selected and not in any sub-folders of that folder. What change(s) do I need
to make so that the code identifies files contained in sub-floders also?

If OptionButton1 Then
EXT = "*.MP3"
ElseIf OptionButton2 Then
EXT = "*.CDG"
ElseIf OptionButton3 Then
EXT = "*.ZIP"
ElseIf OptionButton4 Then
EXT = "*.*"
End If
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
ThePath = .SelectedItems(1) & "\"
End With
fname = Dir(ThePath & EXT)

TIA...Don
 
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
How do I turn off "Initializing Folders" every time I open a file. BIOYA_2000[_2_] Excel Discussion (Misc queries) 1 May 9th 09 05:56 AM
Convert cell "contents" into a "comment" Ryan Excel Discussion (Misc queries) 4 October 3rd 08 11:34 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
how to increase size of "name box" and "contents of cell " displa. Stubby- LIBERTY New Users to Excel 2 February 22nd 07 06:43 PM
"Search for files and folders" option doesnot work for 100% ECouwenberg Excel Discussion (Misc queries) 7 January 11th 06 04:50 PM


All times are GMT +1. The time now is 11:15 AM.

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"