Copy related procedures in class Range (Excel VBA)

This page presents procedures from class Range related to the theme Copy: Copy, CopyFromRecordset and CopyPicture

Copy

Copies the range to the specified range or to the Clipboard.

Copy (Destination)

Destination: Specifies the new range to which the specified range will be copied. If this argument is omitted, Microsoft Excel copies the range to the Clipboard.

Worksheets("Sheet1").Range("A1:D4").Copy _ 
    destination:=Worksheets("Sheet2").Range("E5")

CopyFromRecordset

Copies the contents of an ADO or DAO Recordset object onto a worksheet, beginning at the upper-left corner of the specified range. If the Recordset object contains fields with OLE objects in them, this method fails.

Copying begins at the current row of the Recordset object. After copying is completed, the EOF property of the Recordset object is True.

CopyFromRecordset (Data, MaxRows, MaxColumns)

Dim lngCopyFromRecordset As Long
lngCopyFromRecordset = ActiveCell.CopyFromRecordset(Data:=)

Arguments

The following argument is required

Data (Recordset) - The Recordset object to copy into the range.

The following arguments are optional

MaxRows - The maximum number of records to copy onto the worksheet. If this argument is omitted, all the records in the Recordset object are copied

MaxColumns - The maximum number of fields to copy onto the worksheet. If this argument is omitted, all the fields in the Recordset object are copied

CopyPicture

Copies the selected object to the Clipboard as a picture.

CopyPicture (Appearance, Format)

ActiveCell.CopyPicture

Arguments

The following arguments are optional

Appearance (XlPictureAppearance) - Specifies how the picture should be copied.

Possible Values are xlPrinter - The picture is copied as it will look when it is printed, xlScreen - The picture is copied to resemble its display on the screen as closely as possible.

Format (XlCopyPictureFormat) - The format of the picture.

Possible Values are xlBitmap - Picture copied in bitmap (raster) format: bmp, jpg, gif, png, xlPicture - Picture copied in vector format: emf, wmf.