Copy-method
Copies a cell or a range of cells to the specified range
Syntaxe
procedure Copy(Destination:
IXLSRange; CopyMode: LongWord);
| Destination |
IXLSRange. Specifies the new range to which the specified range will be copied |
| CopyMode |
Optional LongWord. The part of the range to be copied. Default is xlPasteAll |
Description
CopyMode can be one of these XlPasteType constants
| xlPasteAll |
| xlPasteFormats |
| xlPasteValues |
| xlPasteColumnWidths |
| xlPasteNumberFormats |
| xlPasteValuesNumberFormats |
Exemple
This example copies the range A1:D4 on Sheet1 into range E5:H8 on Sheet2
Workbook.Sheets[1].Range['A1', 'D4'].Copy(Workbook.Sheets[2].Range['E5', 'H8']);
Cet exemple copie les formats de la plage A1:D4 de Sheet1 vers la plage E5:H8 de la même feuille
With Workbook.Sheets[1] do begin
Range['A1', 'D4'].Copy(Range['E5', 'H8'], xlPasteFormats);
end;
Cet exemple copie les valeurs de la plage A1:D4 de Sheet1 vers la plage E5:H8 de la même feuille
With Workbook.Sheets[1] do begin
Range['A1', 'D4'].Copy(Range['E5', 'H8'], xlPasteValues);
end;