Code:
'//Sort
If Range("_IndexSort") = "ASCENDING" Or Range("_IndexSort") = "DESCENDING" Then
Dim [B]SortOrder [/B]As String
If Range("_IndexSort") = "ASCENDING" Then
SortOrder = "xlAscending"
ElseIf Range("_IndexSort") = "DESCENDING" Then
SortOrder = "xlDescending"
End If
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Dim SortRange As String
SortRange = Selection.Address
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add Key:=Range("A2"), _
SortOn:=xlSortOnValues, Order:=[COLOR=Red][B]SortOrder[/B][/COLOR], DataOption:=xlSortNormal