ActiveX
To copy data using the Clipboard
- If you do not want to include the column or row headers when you copy data, and you do not want data pasted into the selected column or row headers, set the ClipboardOptions property to 0 (ClipboardOptionsNoHeaders).
- If you want to include the row headers when you copy data, but you do not want data pasted into the selected row headers, set the ClipboardOptions property to 1 (ClipboardOptionsCopyRowHeaders).
- If you do not want to include the row headers when you copy data, but you do want data to be pasted into the selected row headers, set the ClipboardOptions property to 2 (ClipboardOptionsPasteRowHeaders).
- If you want to include the column headers when you copy data, but you do not want data pasted into the selected column headers, set the ClipboardOptions property to 4 (ClipboardOptionsCopyColumnHeaders).
- If you do not want to include the column headers when you copy data, but you do want data to be pasted into the selected column headers, set the ClipboardOptions property to 8 (ClipboardOptionsPasteColumnHeaders).
- If you want to include column and row headers when you copy data and you want data to be pasted into the selected column and row headers, set the ClipboardOptions property to 15 (ClipboardOptionsCopyPasteAllHeaders).
-
If you want a combination of copy and pasting column and row headers, you can Or the 1 (ClipboardOptionsCopyRowHeaders), 2 (ClipboardOptionsPasteRowHeaders), 4 (ClipboardOptionsCopyColumnHeaders), and 8 (ClipboardOptionsPasteColumnHeaders) settings of the ClipboardOptions property as appropriate.
At design time, add the values for the settings and enter that numeric value to provide the following results:
ClipboardOptions
property settingCopy row
headerPaste row
headerCopy column header Paste column header 3 Yes Yes No No 5 Yes No Yes No 6 No Yes Yes No 7 Yes Yes Yes No 9 Yes No No Yes 10 No Yes No Yes 11 Yes Yes No Yes 12 No No Yes Yes 13 Yes No Yes Yes 14 No Yes Yes Yes Note: These property settings do not have a constant (ClipboardOptionsxxxxx) associated with them. Just use the numeric Or value. -
If the AutoClipboard property is set to True, users can use the Clipboard shortcut keys to copy and paste data, or at run time,
- Call the SetSelection method to specify the cell or block of cells from which you want to copy data.
- Call the ClipboardCopy method.
- Call the SetActiveCell or SetSelection methods to specify the cell or block or cells into which you want to paste the data.
- Call the ClipboardPaste method.