Sub TriZone2()
Dim tabtemp(500, 1)
k = 0
For Each c In Range("B3:G40")
If c <> "" Then
tabtemp(k, 0) = c
If c.Hyperlinks.Count > 0 Then tabtemp(k, 1) = c.Hyperlinks(1).SubAddress
k = k + 1
End If
Next
k = 0
For Each c In tabtemp()
If tabtemp(k + 1, 0) = "" Then Exit For
If tabtemp(k, 0) > tabtemp(k + 1, 0) Then
temp1 = tabtemp(k, 0)
temp1l = tabtemp(k, 1)
temp2 = tabtemp(k + 1, 0)
temp2l = tabtemp(k + 1, 1)
tabtemp(k, 0) = temp2
tabtemp(k, 1) = temp2l
tabtemp(k + 1, 0) = temp1
tabtemp(k + 1, 1) = temp1l
If k > 1 Then
k = k - 2
Else
k = -1
End If
End If
k = k + 1
Next
k = 0
For Each c In Range("B3:G40")
c.Value = tabtemp(k, 0)
If tabtemp(k, 1) <> "" Then c.Hyperlinks.Add c, Address:="", SubAddress:=tabtemp(k, 1)
k = k + 1
Next
End Sub