Last active
June 3, 2021 22:02
-
-
Save chipoglesby/73d2662fc83ffea60766 to your computer and use it in GitHub Desktop.
Google App Script - Is range blank? If so, write predefined values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***What should this script do? | |
1. Loop through all of the spreadsheets | |
2. If the row after the row that contains AssociatedCampaignName is blank, Write "Waiting For Spot" in the next row after the cell that contains AssociatedCampaignName, IE: A2 | |
3. Write "#" in B2:H2 | |
**/ | |
function waiting(){ | |
var ss = SpreadsheetApp.getActive(); | |
for(var n in ss.getSheets()){// loop over all tabs in the spreadsheet | |
var sheet = ss.getSheets()[n]; | |
var range = sheet.getRange("A2:H2"); | |
if(range.isBlank()){ | |
sheet.getRange('A2').setValue('Waiting For Spot'); | |
sheet.getRange('B2:H2').setValue('#') } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for sharing. I am using this to create a placeholder within Google Sheets for data input (for quote creation) and it's very handy.