Dear all, I have this code to sort numbers from smallest to largest but i need it to ignore blank cells.
Can anyone help please.
Sub sort1neg()
'
' sort1pos Macro
'
'
Range("a4:aq174").Select
ActiveWorkbook.Worksheets("sort").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("sort").Sort.SortFields.Add Key:=Range("e4:e174"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("sort").Sort
.SetRange Range("a4:aq174")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Thanks
Can anyone help please.
Sub sort1neg()
'
' sort1pos Macro
'
'
Range("a4:aq174").Select
ActiveWorkbook.Worksheets("sort").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("sort").Sort.SortFields.Add Key:=Range("e4:e174"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("sort").Sort
.SetRange Range("a4:aq174")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Thanks