Excel 排序的問題
Function Fn5開獎號大至小( )
'Model = "今彩539落球"
ActiveWorkbook.Worksheets(Model).Sort.SortFields.Clear
ActiveWorkbook.Worksheets(Model).Sort.SortFields.Add Key:=Worksheets(Model).Range("B1"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
'Order:=xlDescending,
'Order:=xlAscending,
With ActiveWorkbook.Worksheets(Model).Sort
'以下這行,要用絕對路徑,就不容易出錯
.SetRange Worksheets(Model).Range("a1").CurrentRegion
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Function
'Model = "今彩539落球"
ActiveWorkbook.Worksheets(Model).Sort.SortFields.Clear
ActiveWorkbook.Worksheets(Model).Sort.SortFields.Add Key:=Worksheets(Model).Range("B1"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
'Order:=xlDescending,
'Order:=xlAscending,
With ActiveWorkbook.Worksheets(Model).Sort
'以下這行,要用絕對路徑,就不容易出錯
.SetRange Worksheets(Model).Range("a1").CurrentRegion
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Function
留言
張貼留言