- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
2#
發表於 2012-3-28 16:05
| 只看該作者
回復 1# enoch
可在作用中的工作表視窗Sheet3 中 做Sheet1的Range("A1:C14") A欄做排序- Sub Ex()
- Sheet3.Activate
- With Sheet1
- .Range("A1:C14").Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:= _
- xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
- SortMethod:=xlStroke, DataOption1:=xlSortNormal
- End With
- '上下的程式碼是相同的效果
- ' Sheet1.Range("A1:C14").Sort Key1:=Sheet1.Range("A2"), Order1:=xlAscending, Header:= _
- xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
- SortMethod:=xlStroke, DataOption1:=xlSortNormal
- End Sub
複製代碼 |
|