Advertisement
bigfoot49211

Untitled

Jul 24th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. function onEdit()
  2. {
  3. var sheet = SpreadsheetApp.getActiveSheet();
  4.  
  5. var total1 = sheet.getRange("F3");
  6. var change1 = sheet.getRange("H4");
  7. var total1num = total1.getValue();
  8.  
  9. var total2 = sheet.getRange("F7");
  10. var change2 = sheet.getRange("H8");
  11. var total2num = total1.getValue();
  12.  
  13. var total3 = sheet.getRange("F11");
  14. var change3 = sheet.getRange("H12");
  15. var total3num = total1.getValue();
  16.  
  17. var total4 = sheet.getRange("F15");
  18. var change4 = sheet.getRange("H16");
  19. var total4num = total1.getValue();
  20.  
  21. if (change1.getValue() !== "")
  22. {
  23. total1num = total1num + change1.getValue();
  24. total1.setValue(total1num);
  25. change1.setValue("");
  26. }
  27.  
  28. if (change2.getValue() !== "")
  29. {
  30. total2num = total2num + change2.getValue();
  31. total2.setValue(total2num);
  32. change2.setValue("");
  33. }
  34.  
  35. if (change3.getValue() !== "")
  36. {
  37. total3num = total3num + change3.getValue();
  38. total3.setValue(total3num);
  39. change3.setValue("");
  40. }
  41.  
  42. if (change4.getValue() !== "")
  43. {
  44. total4num = total4num + change4.getValue();
  45. total4.setValue(total4num);
  46. change4.setValue("");
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement