Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
744 B
4
Indexable
Never
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);
}