Skip to main content

GetEntireRow

Returns a Range object that represents the entire row(s) containing the specified range.

Syntax

expression.GetEntireRow();

expression - A variable that represents a ApiRange class.

Parameters

This method doesn't have any parameters.

Returns

ApiRange | null

Example

Select full rows that overlap with a given range in a spreadsheet.

// How do I highlight all the rows that a range belongs to in a spreadsheet?

// Fill the complete rows of a range with a background color in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let range = worksheet.GetRange("C3:E5");
range.SetValue("Range");
range.SetFillColor(Api.CreateColorFromRGB(173, 216, 230));

let entireRows = range.EntireRow;
entireRows.SetFillColor(Api.CreateColorFromRGB(255, 213, 191));

worksheet.GetRange("A1").SetValue("Entire rows of C3:E5 are highlighted");
worksheet.GetRange("A1").AutoFit(false, true);