Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. var updateCount = 0;
  2. var updateAmount = 10;
  3.  
  4. function showImage() {
  5. var ss = SpreadsheetApp.getActiveSpreadsheet()
  6. var formulaSheet = ss.getSheetByName("Sheet1");
  7. var countCell = formulaSheet.getRange("B2");
  8. var formulaCell = formulaSheet.getRange("B1");
  9.  
  10. if (updateCount < updateAmount) {
  11. updateCount++;
  12. countCell.setValue(updateCount);
  13.  
  14. // Delay 1 second
  15. Utilities.sleep(1000);
  16.  
  17. if (updateCount % 2 )
  18. formulaCell.setFormula('=IMAGE("https://ncviewer.com/img/GithubBanner.png", 1)');
  19. else
  20. formulaCell.setFormula('=IMAGE("https://ncviewer.com/img/ncviewer.png", 1)');
  21.  
  22. // Loop
  23. showImage();
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement