Untitled

 avatar
unknown
plain_text
a year ago
744 B
6
Indexable
function getValuesFromSheets() {
  // Get the active spreadsheet
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

  // Get the sheets by name
  var sheetA = spreadsheet.getSheetByName("A");
  var sheetB = spreadsheet.getSheetByName("B");

  // Retrieve values from specific cells in sheets A and B
  var valueFromSheetA = sheetA.getRange("A1").getValue(); // Change A1 to the cell you want to retrieve from sheet A
  var valueFromSheetB = sheetB.getRange("B2").getValue(); // Change B2 to the cell you want to retrieve from sheet B

  // Log the retrieved values (you can do further processing with them)
  Logger.log("Value from Sheet A: " + valueFromSheetA);
  Logger.log("Value from Sheet B: " + valueFromSheetB);
}