|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
请教:对排序无用的代码什么意思?其它有无瘦身的可能?
Sub Macro1()
Columns("A:A").Select
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=Range("A2:A246") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet2").Sort
.SetRange Range("A1:A246")
'.Header = xlYes
'.MatchCase = False
'.Orientation = xlTopToBottom
'.SortMethod = xlPinYin
.Apply
End With
End Sub
Sub Macro3()
Columns("A:A").Select
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add Key:=Range("A2:A246") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet2").Sort
.SetRange Range("A1:A246")
'.Header = xlYes
'.MatchCase = False
'.Orientation = xlTopToBottom
'.SortMethod = xlPinYin
.Apply
End With
End Sub
|
|