Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onEdit()
- {
- var sheet = SpreadsheetApp.getActiveSheet();
- var total1 = sheet.getRange("F3");
- var change1 = sheet.getRange("H4");
- var total1num = total1.getValue();
- var total2 = sheet.getRange("F7");
- var change2 = sheet.getRange("H8");
- var total2num = total1.getValue();
- var total3 = sheet.getRange("F11");
- var change3 = sheet.getRange("H12");
- var total3num = total1.getValue();
- var total4 = sheet.getRange("F15");
- var change4 = sheet.getRange("H16");
- var total4num = total1.getValue();
- if (change1.getValue() !== "")
- {
- total1num = total1num + change1.getValue();
- total1.setValue(total1num);
- change1.setValue("");
- }
- if (change2.getValue() !== "")
- {
- total2num = total2num + change2.getValue();
- total2.setValue(total2num);
- change2.setValue("");
- }
- if (change3.getValue() !== "")
- {
- total3num = total3num + change3.getValue();
- total3.setValue(total3num);
- change3.setValue("");
- }
- if (change4.getValue() !== "")
- {
- total4num = total4num + change4.getValue();
- total4.setValue(total4num);
- change4.setValue("");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement