atulc
06-03-2008, 11:42 AM
Can someone tell me how do I get top 10 and bottom 10 of a sorted data using VBA? I am using the following code to sort
Range("B26:EE106").Select
Selection.Sort key1:=Range("BF27"), order1:=xlAscending, _
header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
I am not sure if there is a better way to sort but I can live with this. But now I am stuck as to how do I get the top 10 and bottom 10 values from column BF and put it on another sheet?
Thanks
A
Range("B26:EE106").Select
Selection.Sort key1:=Range("BF27"), order1:=xlAscending, _
header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
I am not sure if there is a better way to sort but I can live with this. But now I am stuck as to how do I get the top 10 and bottom 10 values from column BF and put it on another sheet?
Thanks
A