Trying to create if statement such that when a specific cell changes (either D64 or D61) one of the two checkdata functions runs accordingly. Currently only works for the first (d64)? I am new to Script and GSheets transitioning across from MS and VBA so any help gratefully received. Cheers
enter code here
if(e.range.getA1Notation() !== 'D64') return
checkData1()
if(e.range.getA1Notation() !== 'D61') return
checkData2()
}
function checkData1() {
if(SpreadsheetApp.getActiveSheet().getRange("D64").getValue() == "Yes")
SpreadsheetApp.getActiveSheet().getRange("E64").setValue('Task Complete')
else if(SpreadsheetApp.getActiveSheet().getRange("D64").getValue() == "-")
SpreadsheetApp.getActiveSheet().getRange("E64").setValue('Is the NDA.... Complete?')
else if(SpreadsheetApp.getActiveSheet().getRange("D64").getValue() == "Action")
SpreadsheetApp.getActiveSheet().getRange("E64").setValue('NDA Required ASAP')
}
function checkData2() {
if(SpreadsheetApp.getActiveSheet().getRange("D61").getValue() == "Yes")
SpreadsheetApp.getActiveSheet().getRange("E61").setValue('Task Complete')
else if(SpreadsheetApp.getActiveSheet().getRange("D61").getValue() == "-")
SpreadsheetApp.getActiveSheet().getRange("E61").setValue('Is the NDA.... Complete?')
else if(SpreadsheetApp.getActiveSheet().getRange("D61").getValue() == "Action")
SpreadsheetApp.getActiveSheet().getRange("E61").setValue('NDA Required ASAP')
}
Aucun commentaire:
Enregistrer un commentaire