I wrote the following macro to sort data in a column. Can anyone write the macro to copy the first 5% middle 5% and last 5% of my sorted data. I would much appreciate.
Thanks,
-----------------------------------------------------------
Sub sort_1()
Dim wkbook As Workbook
Set wkbook = ActiveWorkbook
Dim iRow As Integer
iRow = wkbook.Sheets("Sheet1").Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
wkbook.Worksheets("Sheet1").Activate
wkbook.Sheets("Sheet1").Range("A3:A" & iRow - 1).Select
Selection.sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
End Sub
Bookmarks