vba - Numbers in array not being sorted numerically -
the program using ibm data collection 6.0 (used program surveys).
the issue i'm having how storing values question. values categories [1, 2, 3, 4, ... 59, 60] (numeric order) labeled values in different order:
1 2 11 12 13 14 15 16 17 18 19 20 3 21 22 23 24 25 26 27 28 29 30 4 31 32 33 34 35 36 37 38 39 40 5 41 42 43 44 45 46 47 48 49 50 6 51 52 53 54 55 56 57 58 59 60 7 8 9 10
can explain me how being sorted , if there easy algorithm put in numeric order?
thanks!
it used sorted alphabetically
add leading zeroes
this example, may help
sub test() dim dic object: set dic = createobject("scripting.dictionary") dim n%, key variant n = 1 while n < 101 dic.add right("000" & n, 3), nothing n = n + 1 wend each key in dic debug.print key next key end sub
can sorted need
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 ...
Comments
Post a Comment