Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Sheet Resources
Featured Formulas
Video Transcript
<div>0:00 Alright, you may know that you can use hyperlink Learn how to create hyperlinks in your spreadsheets for easy navigation. Opens in new tab , and this will create a hyperlink Learn how to create hyperlinks in your spreadsheets for easy navigation. Opens in new tab of any URL you have. And that's pretty cool, but what if you want to have the URL of the spreadsheet Understand the basics of spreadsheets and their functionalities. Opens in new tab itself inside of this hyperlink Learn how to create hyperlinks in your spreadsheets for easy navigation. Opens in new tab , or inside of any formula Get familiar with the syntax used in spreadsheet formulas. Opens in new tab at all?<br>0:21 Uh, there is no sheet URL.
There is no this sheet formula Get familiar with the syntax used in spreadsheet formulas. Opens in new tab , but let's go and create it ourselves, so that we can link to this sheet.<br>0:33 Because we can do some really cool things, like if we have the URL of the sheet, we could paste it in here, go to the end of it, and add copy, and now we can have a link that copies this spreadsheet Understand the basics of spreadsheets and their functionalities. Opens in new tab .<br>0:47 sheet, but we can also write it wrap Discover how to wrap text in your spreadsheet cells for better readability. Opens in new tab it in a formula Get familiar with the syntax used in spreadsheet formulas. Opens in new tab like equals hyperlink Learn how to create hyperlinks in your spreadsheets for easy navigation. Opens in new tab , and then put a label Explore the query label clause for advanced data manipulation. Opens in new tab , copy.<br>0:57 And now we have a button that says copy, and once we click this, it'll make a copy of this spreadsheet Understand the basics of spreadsheets and their functionalities. Opens in new tab for someone.<br>1:05 So that's pretty cool.
We just need to get the URL of this sheet. We don't You want to have to copy-paste the URL every time.<br>1:12 So let's go do that. Let's go to extensions, Apps Script Dive into Apps Script to automate tasks in your Google Sheets. Opens in new tab , and even though this is scripting and coding, it's going to be very simple.<br>1:24 Once this loads, we have a few things. We have an untitled project. We can type URL up here. We have a function Learn about functions and how to use them in your spreadsheets. Opens in new tab called my function Learn about functions and how to use them in your spreadsheets. Opens in new tab .<br>1:33 It has a, uh, parentheses and then brackets. We need to name this function Learn about functions and how to use them in your spreadsheets. Opens in new tab . We're going to call this thisSheet in all caps.<br>1:44 And inside of this function Learn about functions and how to use them in your spreadsheets. Opens in new tab , we're going to do one thing.
We're going to return URL. Well, what is the URL?<br>1:53 We're going to call it variable URL equals Capital S Spreadsheet Understand the basics of spreadsheets and their functionalities. Opens in new tab app with a capital S. Capital A as well. .git active spreadsheet Understand what the active spreadsheet is and how to reference it. Opens in new tab .<br>2:07 Add the two parentheses. .git URL. Command S or there's a button here called Save Project to Drive. Now, we need to use this inside of our sheet.<br>2:23 So we need to do one extra thing. That will allow it to basically auto-complete as if it were a native spreadsheet Understand the basics of spreadsheets and their functionalities. Opens in new tab .<br>2:30 So we're going to do slash and then two, uh, two asterisks. And we're going to write at custom function Learn about functions and how to use them in your spreadsheets. Opens in new tab .
That's all.<br>2:41 Now we're going to click Save again. And now let's go back to our sheet and anywhere we want to type this sheet, there it is.<br>2:52 And let's see if it works. It's going to load. And there it is. That is the, the URL of the spreadsheet Understand the basics of spreadsheets and their functionalities. Opens in new tab .<br>2:58 But one weird thing is it has edit at the end, which we want to be able to use this sort Find out how to sort data in your spreadsheets effectively. Opens in new tab of without that edit.<br>3:07 So let's do one more thing. So we're going to go back to our code and add one thing to our return URL.<br>3:11 And we're going to say .replace.
And here, in quotes, we're going to put in edit and then a comma after the quote.<br>3:18 And we're going to replace it with nothing. So that's just two single quotes here. So we're saying, hey, in this URL, take the word edit and replace it with literally nothing.<br>3:30 So command S, save, and let's go back and get this sheet again. And there we go. We have our blank URL.<br>3:41 So we can add things to it, like ampersand, copy, or rather, concatenate Learn how to concatenate strings in your spreadsheets for better data organization. Opens in new tab . hat, together, this and the word copy. There we go.<br>4:08 So we've added, now, copy to Discover how to copy data to different locations within your spreadsheet. Opens in new tab the end of the URL.
You can click it and see, it works totally fine.<br>4:16 We can wrap Discover how to wrap text in your spreadsheet cells for better readability. Opens in new tab this with hyperlink Learn how to create hyperlinks in your spreadsheets for easy navigation. Opens in new tab and put a label Explore the query label clause for advanced data manipulation. Opens in new tab , copy this sheet, pretty cool. Cool, right? We now have the URL of this sheet.<br>4:28 So now, if we actually made a copy of this sheet, this particular URL would change with this copy. That's pretty cool, I think.<br>4:39 I think this is a really fun way to get the URL inside of your Google Sheet with a little bit of Apps Script Dive into Apps Script to automate tasks in your Google Sheets. Opens in new tab .</div>