montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 984
- Office Version
- 2010
- Platform
- Windows
Hi. I am trying to sort some row from smallest to largest but excel looks like support only vertical data.
I have more than 7000 rows, but in random order,
my array is B2:F8905
this is a tiny example of what I have
and this is the expecting results:
most of the examples I tried do not work, like this
I know I am missing something, but
Thanks guys.
I have more than 7000 rows, but in random order,
my array is B2:F8905
this is a tiny example of what I have
and this is the expecting results:
most of the examples I tried do not work, like this
VBA Code:
Sub So()
Dim ws As Worksheet
Dim Rng As Range
Set ws = Worksheets("Sheet1")
Set Rng = ws.Range("B2:F8905")
Rng.Sort Key1:=Range("2:2"), Order1:=xlAscending
End Sub
Thanks guys.