Bobo DEV
Bobo DEV

Reputation: 11

get name name of cell from his range google script

I want to retrieve the name of a cell having his range. this is the range :

var rangeOfCell = sheet.getRange(100,5);

I want to know how to get his native(A1, AB6,..., ZZA9) name easily

Upvotes: 0

Views: 1136

Answers (1)

Tanaike
Tanaike

Reputation: 201398

In order to retrieve "name of cell" (A1Notation) from sheet.getRange(100,5), please use getA1Notation() as follows.

Sample script:

var rangeOfCell = sheet.getRange(100,5).getA1Notation();
console.log(rangeOfCell)
  • For example, if sheet is declared like var sheet = SpreadsheetApp.getActiveSheet(), this script returns E100.

Reference:

Upvotes: 2

Related Questions