Pete Wright
Member
Hi everyone!
I have an Excel workbook with data that can be sorted with a button.
The problem is, that the data contains alphanumerical data (pure numbers, numbers with text, etc.) and the default Excel sorting algorithm gives wrong results.
To keep things easy I have attached a simplified workbook with less data and only one sheet.
There are two columns: "code" and "color"
Here are some of the possible values for "code":
101, 102, 101/102, 103, 103-A, 103-B, 104, 104 X, 104 Y, 105, 106, 107
The result of the sorting looks like this:
101, 102, 103, 104, 105, 106, 107, 101/102, 103-A, 103-B, 104 X, 104 Y
What it should look like:
101, 101/102, 102, 103, 103-A, 103-B, 104, 104 X, 104 Y, 105, 106, 107
Any ideas how this can be achieved?
Many thanks in advance
Pete
___
I cannot attach the file due to a server error, so I put it on my drive:
vba_sort_text.xlsm
I have an Excel workbook with data that can be sorted with a button.
The problem is, that the data contains alphanumerical data (pure numbers, numbers with text, etc.) and the default Excel sorting algorithm gives wrong results.
To keep things easy I have attached a simplified workbook with less data and only one sheet.
There are two columns: "code" and "color"
Here are some of the possible values for "code":
101, 102, 101/102, 103, 103-A, 103-B, 104, 104 X, 104 Y, 105, 106, 107
The result of the sorting looks like this:
101, 102, 103, 104, 105, 106, 107, 101/102, 103-A, 103-B, 104 X, 104 Y
What it should look like:
101, 101/102, 102, 103, 103-A, 103-B, 104, 104 X, 104 Y, 105, 106, 107
Any ideas how this can be achieved?
Many thanks in advance
Pete
___
I cannot attach the file due to a server error, so I put it on my drive:
vba_sort_text.xlsm