HotXLS 文件

Move 方法

將一個儲存格或一個儲存格範圍移動至指定範圍

語法

procedure Move(Destination: IXLSRange);
procedure Move(Destination: IXLSRange; MoveMode: LongWord);
Destination IXLSRange。指定要將指定範圍移動到的新範圍
MoveMode 選用 LongWord。要移動的範圍部分。預設為 xlPasteAll

說明

MoveMode 可為下列 XlPasteType 常數之一
xlPasteAll
xlPasteFormats
xlPasteValues
xlPasteColumnWidths
xlPasteNumberFormats
xlPasteValuesNumberFormats

範例

此範例將 Sheet1 的 A1:D4 範圍移動至 Sheet2 的 E5:H8 範圍

Workbook.Sheets[1].Range['A1', 'D4'].Move(Workbook.Sheets[2].Range['E5', 'H8']);
此範例將 Sheet1 的 A1:D4 範圍的值移動至同一工作表的 E5:H8 範圍

With Workbook.Sheets[1] do begin
   Range['A1', 'D4'].Move(Range['E5', 'H8'], xlPasteValues);
end;