With ExcelApp.Selection.Sort do
begin
Key1:=Range("B2");
Order1:=xlAscending;
Header:=xlYes;
OrderCustom:=1;
MatchCase:=False;
Orientation:=xlTopToBottom;
SortMethod:=xlPinYin
end;以上代码仅保证代码书写格式
---------------------
begin
Key1:=Range("B2");
Order1:=xlAscending;
Header:=xlYes;
OrderCustom:=1;
MatchCase:=False;
Orientation:=xlTopToBottom;
SortMethod:=xlPinYin
end;以上代码仅保证代码书写格式
---------------------
---------------------
写法:
ExcelApp.Selection.Sort(Key1:=ExcelApp.Selection.Range("B2"), Order1:=xlAscending,Header:=xlYes, OrderCustom:=1, MatchCase:=False,Orientation:=xlTopToBottom,SortMethod:=xlPinYin)
Order2: XlSortOrder; Key3: OleVariant; Order3: XlSortOrder;
Header: XlYesNoGuess; OrderCustom: OleVariant; MatchCase: OleVariant;
Orientation: XlSortOrientation; SortMethod: XlSortMethod; out RHS: OleVariant): HResult; stdcall;
这是DELPHI原型