Dive into spreadsheet automation with this easy to follow script, or copy the sheet and use the script as you wish.
Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Dive into spreadsheet automation with this easy to follow script, or copy the sheet and use the script as you wish.
Sheet Resources
Video Transcript
<div>0:00 This is the laziest checklist Learn how to create an automated checklist in your spreadsheet. Opens in new tab ever. We're going to do some spreadsheet Discover tips for effective spreadsheet management and automation. Opens in new tab automation here. I don't know why I sent myself This email that says create a checklist Learn how to create an automated checklist in your spreadsheet. Opens in new tab that auto checks a checkbox Understand how to use checkboxes for task management in spreadsheets. Opens in new tab every hour or every ten minutes Okay, I sent myself an email about this video and I'm wondering, can we do this?<br>0:23 I haven't even tried to attempt this yet. We're going to do that here in this video. That's basically it. Here's a check list.<br>0:32 We check these off, but can we get the spreadsheet Discover tips for effective spreadsheet management and automation. Opens in new tab to do it itself? Let's try.
We're going to go up to spreadsheet Discover tips for effective spreadsheet management and automation. Opens in new tab sorry, extensions, app script Explore Google Apps Script to enhance your spreadsheet functionality. Opens in new tab .<br>0:43 It's going to create that project for us in real time. Let's see how long this might take us. We're going to do first check function Get to know functions and how they can automate tasks in spreadsheets. Opens in new tab .<br>0:54 That just checks a checkbox Understand how to use checkboxes for task management in spreadsheets. Opens in new tab . Where Learn about using query clauses to filter data in your spreadsheets. Opens in new tab are our checkboxes? I guess we really need to know which checkboxes have been checked.<br>1:03 So it's B2 to B9. Let's call this variable checkboxes to check. I'm going to do spreadsheet Discover tips for effective spreadsheet management and automation. Opens in new tab app dot get active spread, get active spreadsheet Find out how to access and manipulate the active spreadsheet in Apps Script. Opens in new tab .<br>1:18 Add those parentheses because autofocus. Fill doesn't do that.
It autocompletes the name but doesn't autocomplete the parentheses. Let's get a range Understand how to define and work with ranges in your spreadsheets. Opens in new tab .<br>1:27 Because we're lazy we're just going to hardcode this. B2 to B9 to B9. But you know what, I forgot to get.<br>1:37 Get sheet by name. I think we just said sheet one. I don't think we've renamed the sheet yet. Now, dot get range Understand how to define and work with ranges in your spreadsheets. Opens in new tab .<br>1:45 Get values Learn how to retrieve and manipulate values in your spreadsheet cells. Opens in new tab . Okay. We have values Learn how to retrieve and manipulate values in your spreadsheet cells. Opens in new tab now in our checkboxes to check. Now we're going to go through each one and see.<br>1:53 We're going to do a for loop here for i equals zero. I is less than checkboxes to check.length.
See how many are in there.<br>2:06 And we're going to just run this loop through all of them. A plus plus. And now what are we going to do for this loop?<br>2:13 We just want to know, I guess, we only want to check the first one that's not checked. So if we're going to go into and grab this again, if, get range Understand how to define and work with ranges in your spreadsheets. Opens in new tab , don't know if we want this, if range Understand how to define and work with ranges in your spreadsheets. Opens in new tab is going to be row.<br>2:43 I plus 2, and then the column is going to be 2. We only need 1. Dot. Is checked. Okay. So, this is going to be weird.<br>3:05 So basically this is saying is it checked or not?
And if it is checked, we want to, We'll just keep going through the loop.<br>3:17 If it's not checked else, we want to check it and then be done. So we're going to add a break here, I think.<br>3:27 I think we need a break here. We're going to see what happens. So if it's checked, do nothing. Just go back through the loop.<br>3:40 But if it's not checked oh wait, I guess we can do an if not. So if not checked, do this.<br>3:50 We'll do that instead. We'll put a not. The exclamation point puts a not there. But we want to check it.<br>3:57 If it's unchecked, dot check. I think that's it.
But it might go through everything. So if it's checked, break, hmmm, how do we break it?<br>4:16 Let me think about this for a minute. Let's see if we add a break here, if this works. It might check off everything.<br>4:23 Let's just try it. We're gonna command s, save this. It's gonna take a minute. The first time we save, always takes like a minute.<br>4:29 Let's run it, see if we get any errors we might need to authorize. Yeah, review our permissions. Sure. Gimme that sweet, sweet automation, right?<br>4:42 Nope. Alright, let's run it again. It only checked once. There we go.
Okay, that's it. That's all we had to do.<br>4:50 I thought we had to do something else. But now we want to do this every hour. So what we can do is run this check.<br>5:00 Let's go triggers, add trigger Discover how to set up triggers for automated tasks in Google Sheets. Opens in new tab . We're going to choose our check one. We're going to do a time driven. We want minutes timer and we want every, wait, is it actually our timer?<br>5:18 Our timer. Our timer every hour. Save. Done. Alright, that's the laziest checklist Learn how to create an automated checklist in your spreadsheet. Opens in new tab ever. So now, we will come back to this and basically, literally, that trigger Discover how to set up triggers for automated tasks in Google Sheets. Opens in new tab is just going to go over to your editor Get familiar with the Apps Script editor for coding your spreadsheet automations. Opens in new tab , go find check, run check and click on it.
Click this, every hour.<br>5:40 Click. And then, we're going to go back and check. Yup, third one's checked. And every hour, it's going to check.<br>5:47 This is the laziest checklist Learn how to create an automated checklist in your spreadsheet. Opens in new tab ever. We create a checklist Learn how to create an automated checklist in your spreadsheet. Opens in new tab , run this automation, and we're done with our jobs, right? Our checklists are checked.<br>5:55 Done. I hope you enjoyed this one. Bye.</div>