ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using FoundFiles to list by path and filename (https://www.excelbanter.com/excel-programming/358968-using-foundfiles-list-path-filename.html)

Jon[_21_]

Using FoundFiles to list by path and filename
 
I am using a macro that lists files that are in the directory I choose
via browseforfolder. The founfiles function lists files
alphabetically, regardless of which subfoler it is in. Is there a way
to get a list of files in a folder to appear alphabetically, and then
continue the list with files in the first subfolder and so on?

for example, if i have a folder called 'pictures' that has sub folders
'home' and 'vacation' I would want all the files in 'pictures' to be
listed, then the files in 'home', then the files in 'vacation'. Thanks
for any help/advice you can give.


Tom Ogilvy

Using FoundFiles to list by path and filename
 
If you are going to put them in a worksheet, why not put them in the
worksheet and sort them.

--
Regards,
Tom Ogilvy

"Jon" wrote in message
oups.com...
I am using a macro that lists files that are in the directory I choose
via browseforfolder. The founfiles function lists files
alphabetically, regardless of which subfoler it is in. Is there a way
to get a list of files in a folder to appear alphabetically, and then
continue the list with files in the first subfolder and so on?

for example, if i have a folder called 'pictures' that has sub folders
'home' and 'vacation' I would want all the files in 'pictures' to be
listed, then the files in 'home', then the files in 'vacation'. Thanks
for any help/advice you can give.




Jon[_21_]

Using FoundFiles to list by path and filename
 
figured it out, i just did a sort ascending command. works like a
champ.

range("B9:F" & count + 9).Select
Selection.Sort Key1:=range("B9"),
Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal



All times are GMT +1. The time now is 10:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com