ANStrSort2

Sort list of strings in ascending or descending order using pure VBA, no dependency on any outside library.
Works with list of numbers or strings or combination of both.
It uses Collection to create new list that is sorted
Pass string of items, separated by separator, along with sort order, and the separator to be used, function will return string of items listed in ascending or descending order.

This can be considered another copy of List_ItemsSort function from ANStrList functions but without using outside library

Edit 2025-08-07: Adding ability to control case sensitive to the comparison

CodeFunctionName What is this?

Public

Tested

Original Work

Access is limited.

Login here using your Linkedin account. to see or download code.

No registration, not another password to remember, login using your Linkedin account and have access to all public codes in Mydev.net

Linkedin Login

Parameters

ANStrList, Optional Asc1_Desc2 = 1, Optional Sepa = "|"

Examples

? anstrsort2("31|3|f|anmar|bold|Bold codes")
3|31|Bold codes|anmar|bold|f
? anstrsort2("31|3|f|anmar|bold|Bold codes",2)
f|bold|anmar|Bold codes|31|3

Permanenet link

Statistics

Views 977

Downloads 371

IDs

CodeID
DB ID

Requirements

Codes Required 0

Similar Codes

Similar codes

By Developer

Recent 4 by ANmarAmdeen 4

Random Codes

Random Codes 4