返回列表 上一主題 發帖

甚麼程序需要在作用工作視窗在才可以進行

回復 1# enoch
可在作用中的工作表視窗Sheet3 中 做Sheet1的Range("A1:C14") A欄做排序
  1. Sub Ex()   
  2.    Sheet3.Activate   
  3.    With Sheet1
  4.         .Range("A1:C14").Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:= _
  5.         xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
  6.         SortMethod:=xlStroke, DataOption1:=xlSortNormal
  7.     End With
  8.     '上下的程式碼是相同的效果
  9.     '    Sheet1.Range("A1:C14").Sort Key1:=Sheet1.Range("A2"), Order1:=xlAscending, Header:= _
  10.         xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
  11.         SortMethod:=xlStroke, DataOption1:=xlSortNormal   
  12. End Sub
複製代碼

TOP

        靜思自在 : 慈悲沒有敵人,智慧不起煩惱。
返回列表 上一主題