Skip to main content

GetUsedRange

Returns the ApiRange object that represents the used range on the specified worksheet.

Syntax

expression.GetUsedRange();

expression - A variable that represents a ApiWorksheet class.

Parameters

This method doesn't have any parameters.

Returns

ApiRange

Example

This example shows how to get the ApiRange object that represents the used range on the specified worksheet.

var oWorksheet = Api.GetActiveSheet();
var oUsedRange = oWorksheet.GetUsedRange();
oUsedRange.SetFillColor(Api.CreateColorFromRGB(255, 213, 191));