I have created a custom function called =matchlist
using apps script. That function is working with no problem. I also created another function called refreshTBA
which clears the content of a certain cell (A2
) and replaces it with the formula =matchlist(Setup!$b$2)
. When I run this function while I have the sheet open, there is no problem. However, any time I navigate away from the page and open it back up, the function in the cell is =matchlist(#REF)
.
Here is the code for the refreshTBA function:
function refreshTBA() {
var ss = SpreadsheetApp.getActive().getSheetByName("MatchImport")
var cell = ss.getRange("A2")
cell.clearContent()
cell.setFormula('=matchlist(Setup!$b$2)')
var cell = ss.getRange("A300")
cell.clearContent()
cell.setValue('Refreshed')
}