Skip to main content

SetFontSize

Sets the font size to the characters of the current cell range.

Syntax

expression.SetFontSize(nSize);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nSizeRequirednumberThe font size value measured in points.

Returns

This method doesn't return any data.

Example

This example sets the font size to the characters of the cell range.

// How to resize a cell font size.

// Get a range and set its font size.

let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A2").SetValue("2");
let range = worksheet.GetRange("A1:D5");
range.SetFontSize(20);