LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Filesearch returning files not in alphabetical order?

Hi,

I have a macro where I do the following:
1) Search for all files in a directory:
Set fs = Application.FileSearch
With fs
.LookIn = dirtosearch
.SearchSubFolders = True
.Filename = "*.*"
.Execute
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
Max = .FoundFiles.Count
for i = 1 to max
list(i) = .foundfiles(i)
next i
******at this point I pause the code
And look at the list array using the watch window, expecting that the
entries are in alphabetical order by the filename.

What I find is it is "almost" in alphabetical order. I found, for
example, the filename for 1213="Mat...", 1214="Man...", 1215="Mat..."!

Help! For my code I need the files to be alphabetized. What am I doing
wrong? Suggestions?

Thanks everyone,

Phil

 
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
order of opening files with sumproduct returning #REF! sharon p Excel Worksheet Functions 2 September 15th 09 05:29 PM
How do you view files in an alphabetical ORDER ? John Excel Discussion (Misc queries) 1 July 11th 08 05:54 PM
Alphabetical order of files LD Excel Discussion (Misc queries) 1 June 23rd 06 10:22 AM
why are my files out of alphabetical order? kwardja Excel Discussion (Misc queries) 2 June 19th 06 02:32 PM
FileSearch macro returning incorrect docs? Ed[_9_] Excel Programming 2 December 10th 03 05:48 PM


All times are GMT +1. The time now is 06:12 PM.

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"