apps-script-utils 2.1.1 Help

highlightHtml

function highlightHtml( range: GoogleAppsScript.Spreadsheet.Range, theme: Theme | null | undefined = {} ): GoogleAppsScript.Spreadsheet.Range;

The cells are read as text, tags, attribute names, values, comments and text content are told apart, and the cells are written back as rich text with each part in its own colour. A theme decides the colours.

Parameters

Parameter

Type

Description

range

GoogleAppsScript.Spreadsheet.Range

The range whose cells are highlighted.

theme (optional) = {}

Theme \| null \| undefined

The colour for each kind of token.

Returns

GoogleAppsScript.Spreadsheet.Range — the same range.

Throws

Exception

Condition

InvalidRangeException

the first argument is not a range.

Examples

In use

const range = SpreadsheetApp.getActiveRange(); highlightHtml(range);

See also

Source

src/appsscript/sheet/highlightHtml.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.