montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 986
- Office Version
- 2010
- Platform
- Windows
Hi.
Column B there are a bin of numbers, column C the frequency of this numbers.
In order for me to RANK them, I have to Editing with sort & filter
I want to find a real short way to code this,
example:
So the macro I got is:
any way to trim this.
thanks.
Column B there are a bin of numbers, column C the frequency of this numbers.
In order for me to RANK them, I have to Editing with sort & filter
I want to find a real short way to code this,
example:
So the macro I got is:
VBA Code:
//////////////////////////////////////////////----COPY AND PASTE -----/////////////////////////////////////////////////
Range("H2:I37").Copy
Range("T2").PasteSpecial Paste:=xlPasteValues
'///////////////////////////////////////////////--------SORTING--------///////////////////////////////////////////////////
Range("T2:U37").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("U2:U37") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("T1:U37")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
thanks.