The answer from brettdj (thank-you brettdj) works well and probably the method I will use, but I found something else that also works, and this may give an advantage in other situations. Firstly, it retains the extreme ease of using Dir to scroll through folders.
In Excel 11, I use Dir (as described in the question) to create a list of jpg files from each folder (one folder at a time) sorted alphanumeric in Col A. Then I use Custom List to sort Col A with (fake) digital sorting so that I can process jpg in sequential order. Then clear Col A and repeat the next folder.
To create a custom list:
in row 1 of the working column, enter
=ROW() & ".jpg"
and Fill anything you want. In my case, I used 1000 elements in my user list, because the maximum number of jpg that I expect in any folder.
User lists accept only text (or "plain text" in accordance with MS Help), so the newly created list of formulas must be converted to text using Insert> Special> Values ββbefore importing as a user list. Each item in the list is one of the expected file names. The final user list is as follows:
1.jpg 2.jpg 3.jpg β¦ β¦ 1000.jpg
After importing a new user list (Tools> Options> User Lists> Import), it becomes available in the drop-down menu in the menu "Data"> "Sort"> "Parameters"> "Order of sorting the first key".
If you are doing this sort with VBA, then this is what Recorder writes:
Range("A:A").Select Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=6, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal
The first 5 custom lists are built into Excel, so OrderCustom: = 6 is a new custom list. Remember to change this to OrderCustom: = False when doing regular sorting. User lists remain attached to the Wkb that they created until deleted.