1

I have two sheets in my workbook:

  • In sheet1 in cell_1 by address sheet1!A1 I store my data.
  • In sheet2 in cell_2 by address sheet2!A1 I have the formula =sheet1!A1.

So the value of cell_2 always mirrors the value of cell_1. And the formula in cell_2 dynamically changes when I drag cell_1 on sheet1 or rename sheet1 (for example: '=sheet1!A1' transforms to '=newSheetName!B2').

I won’t get 'sheet name' 'N of column' and 'N of row' of cell_1 from the formula in cell_2. N of column I get by COLUMN(cell_1) and N of row I get by row(cell_1). To get the sheet name I tried a macro:

function getSheetName (link_to_my_cell){    
var myformula = link_to_my_cell.getFormula(); // and later I get sheet name by the myformula    
return (mySheetName);    
}

When I then set the cell_3 formula to =getSheetName(link_to_cell_1) it worked but if I rename sheet1 this method does not refresh the value of cell_3. It works properly only if I start function getSheetName by trigger, maximum once per minute.

How can I get the sheet name in cell_3 from a formula in cell_2 'on the fly'?

Rubén
  • 34,714
  • 9
  • 70
  • 166
PoziTV
  • 31
  • 3
  • 2
    Possible duplicate of [Refresh data retrieved by a custom function in google spreadsheet](http://stackoverflow.com/questions/17341399/refresh-data-retrieved-by-a-custom-function-in-google-spreadsheet) – Rubén Oct 22 '16 at 01:20

0 Answers0