How to Clip Text Automatically Google Sheets

Learn how to automatically clip text in Google Sheets using a simple app script function. This tutorial will guide you through the steps to ensure your text remains clipped in specified columns.

One of the interesting parts of Google Sheets is that when we copy and paste text or links or lot of text in, sometimes it's not clipped. So you see this ravensburger column here? It is clipped. It is with the setting here clipped text. This Amazon one though is not, and we don't find that out because it automatically will clip it if there is text in the next column over. But if we delete some of these, if we delete these text. Text. In the D column. In the C column, you can see that it is not clipped. So there's a couple of issues here that you may be running into one. You want to clip your text all the time. Two. You may not know that it's not clipped. You may copy and paste text from somewhere else and it gets unclipped,

or you may copy and paste text from another sheet which doesn't have the correct formatting , but you want to automatically always have clipped text on maybe these two columns, C and d. I'm gonna show you how to do that right now. Go to Extensions app script . I am gonna name this clip text. We're gonna write a function here on edit. Now, this function is a built in function . We just have to type the words here and we're gonna say every time we edit something, these two columns, C and d, on sheet one, let's say. Are going to be clipped. So let's do spreadsheet app dot, get active spreadsheet , get it in the entire file, get sheet by name and do in quotes, sheet one. We're gonna get range starting with row one column. Three, because it's C column. Actually we can just do CD here.

We can just do it without having to do numbers. I. And here's the trick, we're gonna set wrap strategies. So you just strategy and I'm gonna put this on a new line so you can see the whole thing. We're gonna do spreadsheet , app wrap strategy, make sure these are capitalized exactly this way. Spreadsheet app, SNA, wrap strategy. W and S, if you do not capitalize these correctly, they won't work or they should not work. And then we're gonna do dot and in all caps, clip . Now there was a little bit of auto fill here that if I just do the correct way and I can do dot clip and I can just select it so I don't have to type it all out. But if you're typing it all out, just make sure all of your capitalization is correct and make sure you actually have this sheet here.

And I'm gonna save this. I'm just gonna click command S, or there's a save project to drive button right here next to run. Now this is one line and that's all you have to do. Now, watch as I, if I add, let's say another text here, everything is clipped. So even if I copy paste from another sheet into here, if I change the text in any cell, any cell, it's going to automatically clip . Columns C and D here. If you wanna change the range , do it right here and get range . If you wanna change the sheet name , do it here. If you always wanna do it on every single tab, and you don't want to have to name all of them, so just do get active sheet . And that will allow you to do it on every single sheet, same exact

columns, but if you have very specific columns on different sheets, then I would say do it on just the sheet. And you can also copy and paste this to say, okay, do this on sheet two. On column B through C, perhaps, or just B column. You can have multiple of these in here. 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.