関数が実行されている行と列を取得するメソッドがあるのだろうか。たとえば、私のスプレッドシートでは、C5 は式 : "=myFunction()" と同じです。
function myFunction() {
// get the row and column [ result : C5 ];
};
関数が実行されている行と列を取得するメソッドがあるのだろうか。たとえば、私のスプレッドシートでは、C5 は式 : "=myFunction()" と同じです。
function myFunction() {
// get the row and column [ result : C5 ];
};
あなたは試してみることができます:
var activeCell = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getActiveCell();
または、範囲が1x1であると仮定して、範囲を介して取得します(範囲で.getNumRows()および.getNumColumns()を使用してこれを確認する必要があります)
var activeRange = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getActiveRange();
と使用
var a1Not = activeRange.getA1Notation();
また
var X = activeRange.getColumn()
var Y = activeRange.getRow()
絶対 r[X]c[Y] 表記と配列処理で使用します。
RTFM - フレンドリーなマニュアルを読んでください :)
https://developers.google.com/apps-script/reference/spreadsheet/range