Edit font family

Here is a tip how to edit font family.

 

Source code

function setFontType() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sh = ss.getActiveSheet();
  var fontFamily = "Comic Sans MS";

  ss.getActiveRange().setFontFamily(fontFamily);

  var hd = "New Font Family: ";
  var nw = ss.getActiveRange().getFontFamily();

  Browser.msgBox(hd + nw);
}

 

Format

RangeObject.setFontFamily(fontFamily)

 

Parameters

fontFamily … Set the font family name in string format.

 

Responses

None

 

How to get a range’s object?

Please refer the following tips.

Get an active range object

Get a range object by row & column number

Get a range object by address

 

How to get font family?

Please refer the following tip.

Get font family

Leave a Comment