View Single Post
  #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