View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
cyzax7 cyzax7 is offline
external usenet poster
 
Posts: 2
Default how to create macro that will display the sub_subfolder

hi,

It doesn't work. I want to create the macro that display my subfolder. the
problem is, it display only the FILES (for example files of type: sample1.
ppt, sample2.txt and etc ) in the main_folder (not the sub folder that I want)



ADG wrote:
Hi

Copeid below example on FileDialog from the help text in Excel, this could
be an option for you. Just replace the message box code etc

Sub UseFileDialogOpen()

Dim lngCount As Long

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show

' Display paths of each file selected
For lngCount = 1 To .SelectedItems.Count
MsgBox .SelectedItems(lngCount)
Next lngCount

End With

End Sub
I have a main_folder (I name it as Folder_A) which contains many subfolder
(Folder_1, Folder_2,Folder_3, ...Folder_n). where in each subfolder contains

[quoted text clipped - 6 lines]

I have tried so many ways, but it doesn't works.