Euro5
asked on
vba sort by column error
I am getting an error on
.Columns("A:K").Sort key1:=Range("K2"), _
I have columns A-K, I am trying to sort by K, largest to smallest.
Can anyone help?
.Columns("A:K").Sort key1:=Range("K2"), _
I have columns A-K, I am trying to sort by K, largest to smallest.
Can anyone help?
Sub Sort_count()
Application.ScreenUpdating = False
Sheets("Change Box Size").Activate
Dim LastRow As LongPtr
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
Range("K1") = "Index"
.Columns("A:K").Sort key1:=Range("K2"), _
order1:=xlAscending, Header:=xlYes
With Application
CalcMode = .Calculation
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
~bp