Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Rodolfo Ramirez   on Dec 11 In MS Office Category.

  
Question Answered By: Myrna Brown   on Dec 11

On the ASCII chart, space is 32, minus is 45 and one is 49, so a straight
ASCII comparison will indeed give the results you are getting from the VBA
immediate pane.

(Note that your statements in the immediate pane  shouldn't really be called
sorting policy, they are simply comparisons of two ASCII strings.)

The following sort order  description is from a web page, but indicates that
it's a direct quote from Excel help:

a.. Numbers: Excel sorts numbers from the smallest negative number to the
largest positive number.
b.. Dates: Excel sorts dates from earliest to latest.
c.. Alphanumeric: Excel sorts text from left to right, character by
character. For example, if you have the contents "H310" in a cell, Excel
would sort that cell after another cell that contains "H3", but before a
cell that contains the entry "H32." Excel sorts text in the following order:
0 1 2 3 4 5 6 7 8 9 (space) ! " # $ % & ( ) * , . / : ; ? @ [ \ ] ^ _ ` {
| } ~ + < = > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z. Special
case: Excel ignores apostrophes (') and hyphens (-) unless two text strings
are the same except for a hyphen, in which case the text with the hyphen is
sorted last.
d.. Blanks: Blanks always come at the end.
(I haven't tried to find the help information to verify the quote.)

So, Excel has a quite complex sorting  policy.

This is not uncommon. Sort policies in other systems are frequently not
just a strict ASCII comparison.

Share: