A family of Microsoft word processing software products for creating web, email, and print documents.
Do you have an = separating the fields?
You will get an error if there is a mis-match between the field separator used and the Separator:= in the code.
Here if I use = as the field separator, sorting on Field 2 works with your code. However, if I use
Separator:=vbTab and the fields are separated by =, a 9125 error occurs. If is separate the fields with a tab space then the code using Separator:=vbTab works.
The reason why you can sort on Field 1 with a mismatch between the field separator that is use and that in the code is because the string does not then have to be parse to obtain the field on which to sort.