Message 1 of 4
Logical sort order in listbox

Not applicable
02-23-2005
12:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Any ideas on how to make the following list of items:
OP1
OP10
OP11
OP2
SCR
sort as:
OP1
OP2
OP10
OP11
SCR
in a listbox?
I want all of the digits in the string to be used in the sort, not digit by digit.
Should I break up the text characters vs digits and then use the Format function:
Format("1", "0#")
Format("2", "0#")
Format("10", "0#")
Or, how about regular expressions? I think I could do this rather easily with Perl regular expressions, but I'm not sure if the VBA equivalent can do this.
I'm thinking others have already tackled this issue and may have a solution.
Thanks.
OP1
OP10
OP11
OP2
SCR
sort as:
OP1
OP2
OP10
OP11
SCR
in a listbox?
I want all of the digits in the string to be used in the sort, not digit by digit.
Should I break up the text characters vs digits and then use the Format function:
Format("1", "0#")
Format("2", "0#")
Format("10", "0#")
Or, how about regular expressions? I think I could do this rather easily with Perl regular expressions, but I'm not sure if the VBA equivalent can do this.
I'm thinking others have already tackled this issue and may have a solution.
Thanks.