Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var updateCount = 0;
- var updateAmount = 10;
- function showImage() {
- var ss = SpreadsheetApp.getActiveSpreadsheet()
- var formulaSheet = ss.getSheetByName("Sheet1");
- var countCell = formulaSheet.getRange("B2");
- var formulaCell = formulaSheet.getRange("B1");
- if (updateCount < updateAmount) {
- updateCount++;
- countCell.setValue(updateCount);
- // Delay 1 second
- Utilities.sleep(1000);
- if (updateCount % 2 )
- formulaCell.setFormula('=IMAGE("https://ncviewer.com/img/GithubBanner.png", 1)');
- else
- formulaCell.setFormula('=IMAGE("https://ncviewer.com/img/ncviewer.png", 1)');
- // Loop
- showImage();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement