Skip to main content

Paste

Pastes the Range object to the specified range.

Syntax

expression.Paste(rangeFrom);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
rangeFromRequiredApiRangeSpecifies the range to be pasted to the current range

Returns

This method doesn't return any data.

Example

Paste the Range object to the specified range in a spreadsheet.

// How to get a range and paste it into another one in a spreadsheet.

// Create a range and add it to another one in a spreadsheet.

let worksheet = Api.GetActiveSheet();
worksheet.GetRange("B4").SetValue("1");
worksheet.GetRange("C4").SetValue("2");
worksheet.GetRange("D4").SetValue("3");
let rangeFrom = worksheet.GetRange("B4:D4");
let range = worksheet.GetRange("A1:C1");
range.Paste(rangeFrom);