How to Clear Formatting Automatically in Google Sheets

Learn how to automatically clear formatting in Google Sheets every day, ensuring a fresh start with default settings. This tutorial guides you through creating a script and setting up triggers for seamless automation.

you wanna clear your formatting , but you wanna do it automatically. We wanna do this say every day at a certain time, because people may be coming into your sheet or you yourself come into your sheet. Edit the formatting , but you wanna just clear all that formatting every day. So you have a fresh sheet that looks like a default sheet with white background, black text. Everything is un reformatted each and every day. Maybe you have some, uh, bold or highlights. You add to it each day to get through a list, but you just want to clear it every single day, every single night, or even in the morning before you go to work. Here's how to do it. Go up to Extensions app script . We are gonna write a function called clear formatting . Put some parentheses there and curly brackets.

And inside the curly brackets we just need one line of script, spreadsheet , app. Do get active spreadsheet , get active sheet clear. Formats and put parentheses at the end there. Now we can try this out from here just to make sure it works and to give it the proper permissions. Click run. Let's go back to our sheet and we can see it's completely clear. A formatting . If you want to name the sheet a certain sheet and you only wanna clear that formatting . Let's do that. We will do spreadsheet app. Do get active spreadsheet . That's the entire workbook file. Get sheet by name. And here we'll put sheet one in quotes, then clear formats and let's try that. So we'll go back to our sheet. We'll add a little bit of formatting , some garishness here.

Let's click clear formatting sheet one. Run it. And go back and our formatting is completely cleared. Now this is very similar to, by the way, if we just add. Some more formatting here, going just between a and one and hitting command and slash or backslash, uh, that also clears all the formatting . But say we wanna do this automatically, right? We want this to be happening every day without our interaction. Just clear that formatting . Well, we have our function here. Clear formatting sheet one or just clear formatting of the active sheet. I'm gonna delete this one and just have one function here. Clear formatting, I'm gonna call it that. And it's calling that on just sheet one. Or whatever sheet you want to name it, but let's do this automatically. Just takes a few clicks over on the left side.

Click triggers over on the bottom right click add trigger . Choose which function to run. If you have multiple functions , they'll show up here and select event source. Time driven. Now, this is the automation. This is where we select Daytimer. If we wanna do it every day and our time, let's say it's before we come to work, 4:00 AM to 5:00 AM It'll happen at some random time between then the very first time, but then every 24 hours, it'll run every 24 hours. Click save. And if you haven't given it permissions yet, it will ask you then to give permissions. And now we have a trigger , and this is gonna run every single day. But if you want to delete this, if you wanna say, Hey, I don't need this trigger to happen, come back here to triggers. Go over to the three dots on the far right and click delete trigger, and

you can delete your trigger forever. But that's how to clear formatting automatically every day. Or you can do it every week or every month, or every hour if you want. There you go. That's how to clear formatting automatically. You are watching better sheets here on YouTube. Make sure you check out this video or this video and subscribe right now to get more tips, tricks, how tos, get more out of your Google sheets than you ever have before. I'm excited to be making a ton more videos here. Ask me questions down in the comments and I will answer them in future videos. But for right now, right here, one of these videos is gonna be your next Google sheet.