well yah indeed that is true. It is much easier to make up another column of it.
btw, how to ensure that the sorting column can sort any amount of data? because now currently the range is on specific to what I did during sorting.
PHP Code:
Sub Macro5()
'
' Macro5 Macro
'
'
Range("S2").Select
ActiveCell.FormulaR1C1 = "=ABS(RC[-5])"
Range("S2").Select
Selection.AutoFill Destination:=Range("S2:S27")
Range("S2:S27").Select
Columns("S:S").Select
ActiveWorkbook.Worksheets("Sheet3").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet3").Sort.SortFields.Add Key:=Range( _
"S2:S100005"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Sheet3").Sort
.SetRange Range("A1:S100005")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Bookmarks