Trying to call a variable from a sub function, but "sheet" is not defined. Any suggestions on how to call it?
function getDate(){
var mnthYearDate = Utilities.formatDate(new Date,"EST","MMM yyyy");
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(mnthYearDate);
}
function getValue(){
getDate();
var target = sheet.getRange("A1").getValue();
}