[10.0.0 - version 52] GESI - Google Sheets ESI Add-On - Now an EVE Online Partner!

Here’s a script you can attach to a couple cells to refresh static and dynamic data. Then attach the functions you want refreshed to the cells being changed by the script.

Just remember to create a space in your spreadsheet to have the cells in, maybe a seperate page called Utilities :wink:


function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Or DocumentApp or FormApp.
  ui.createMenu('Custom Tools')
      .addItem('Refresh All Data','refreshData')
      .addToUi();
} 

// Function to refresh data

function refreshData() {
    refreshData1()
    refreshData2()
    refreshData3()
}
  
function refreshData1 () {

// Load sheet with variable
    
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('Utility');
  var cell = sheet.getRange('Utility!B3');
  var cell2 = sheet.getRange('Utility!C3');
  
//Change Value To 0
    
    cell.setValue(0);
    cell2.setValue(0);

}

function refreshData2(){

//Load sheet with variable

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('Utility');
  var cell = sheet.getRange('Utility!B3');

//Time delay before changing back
  
    Utilities.sleep(2000)
  
//Set Value Back to 1
  
    cell.setValue(1);
  
}

function refreshData3(){

//Load sheet with variable

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('Utility');
  var cell2 = sheet.getRange('Utility!C3');

//Time delay before changing back
  
    Utilities.sleep(2000)
  
//Set Value Back to 1
  
    cell2.setValue(1);
  
}