My English is bad, please forgive me
I use the following code I have an array of strings arranged in Malay
But found a problem. That is, the number of strings arranged in front of the wrong. As follows:
1.abcdefg
10.abcdefg
11.abcdefg
12.abcdefg
13.abcdefg
14.abcdefg
15.abcdefg
16.abcdefg
2.abcdefg
3.abcdefg
4.abcdefg
5.abcdefg
6.abcdefg
7.abcdefg
8.abcdefg
9.abcdefg
How can I use a string array can be sorted into the following
1.abcdefg
2.abcdefg
3.abcdefg
4.abcdefg
5.abcdefg
6.abcdefg
7.abcdefg
8.abcdefg
9.abcdefg
10.abcdefg
11.abcdefg
12.abcdefg
13.abcdefg
14.abcdefg
15.abcdefg
16.abcdefg
thank
Private Sub SortStrings(ByRef sArray() As String, ByVal nFirst As Integer, ByVal nLast As Integer)
Dim nBoundary As Integer
Dim i As Integer
If nLast <= nFirst Then Exit Sub
SwapS sArray(nFirst), sArray((nFirst + nLast) / 2)
nBoundary = nFirst
For i = nFirst + 1 To nLast
If StrComp(sArray(nFirst), sArray(i), vbTextCompare) = 1 Then
nBoundary = nBoundary + 1
SwapS sArray(nBoundary), sArray(i)
End If
Next
SwapS sArray(nFirst), sArray(nBoundary)
SortStrings sArray(), nFirst, nBoundary - 1
SortStrings sArray(), nBoundary + 1, nLast
End Sub
Private Sub SwapS(ByRef Str1 As String, ByRef Str2 As String)
Dim sTemp As String
sTemp = Str1
Str1 = Str2
Str2 = sTemp
End Sub