tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,194
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Everyone,
I have this simple sort to sort by two columns in a range,
works great but not on 2010 version,
can anyone give me a version that will work on 2010 please
heres my version
thanks
tony
I have this simple sort to sort by two columns in a range,
works great but not on 2010 version,
can anyone give me a version that will work on 2010 please
heres my version
VBA Code:
Sub SortAscending1()
Application.EnableEvents = False
Application.ScreenUpdating = False
Call AA_unProtect
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add2 Key:= _
Range("C8:C1003"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortNormal 'its breaking here!!!!!
ActiveSheet.Sort.SortFields.Add2 Key:= _
Range("D8:D1003"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveSheet.Sort
.SetRange Range("C7:AD1003")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Range("G8:G1003").Rows.AutoFit
Call AA_Protect
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
thanks
tony