Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Sheet Resources
Video Transcript
<div>0:00 Here's a very interesting problem and a very simple solution with Apps Script Learn how to automate tasks in Google Sheets with Apps Script. Opens in new tab . Basically, we want to download all of the tabs in a CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab file, but when we go up to File, Download, a CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab , it's only going to download this exact tab that we're on.<br>0:16 It's not going to download every single CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab file.
So, in order to do that, we need a little bit of Script.<br>0:22 Go up to Extensions, Apps Script Learn how to automate tasks in Google Sheets with Apps Script. Opens in new tab , and I've written out all of this Script for you so far, but we're going to implement this into the sheet so it's super easy to use for a user.<br>0:34 So, just want to explain the Script a little bit before we implement it.
We're getting the active sheet Discover what the active sheet is and how to reference it. Opens in new tab , we're getting all of the sheets, and then we're going to actually use URL Fetch App to go to the very specific URL, which is, you can add, at the end of a spreadsheet Get familiar with spreadsheets and their functionalities. Opens in new tab file, URL, you can add slash <br>0:55 export Find out how to export data from Google Sheets in various formats. Opens in new tab question mark format Explore different formatting options for your spreadsheet data. Opens in new tab equals CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab , and then you can combine Learn how to merge cells in Google Sheets for better data presentation. Opens in new tab that with the GID, which is the very specific ID of the tab.<br>1:05 And now what it's going to do is it's going to save each of those URLs as a CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab .
CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab file, then it's going to zip it all up and save it to your Google Drive here.<br>1:19 And at the end it's going to give us a URL of a zip drive that's created on our Google Drive.<br>1:26 So let's see that in action and then implement it in our sheet. So we're just going to click run. And over on our tab, it's a zip created and we're just going to go to that URL.<br>1:44 And here's the two files. I can download this as a zip file, but let's make this super easy to use.<br>1:50 I'm going to go to bettersheets.co snippets slash snippets.
And I'm going to grab this code here, which is a function Understand the basics of functions in Google Sheets. Opens in new tab on open.<br>1:59 I'm going to go back to my Apps Script Learn how to automate tasks in Google Sheets with Apps Script. Opens in new tab . Go to the very top, hit enter a few times, make some space to paste this.<br>2:05 I don't need document app or form app. I just need spreadsheet Get familiar with spreadsheets and their functionalities. Opens in new tab app, custom menu Create custom menus in Google Sheets to enhance user experience. Opens in new tab . I'm going to call this download csv Learn how to download your spreadsheet data as a CSV file. Opens in new tab menu.<br>2:14 And the first item is, I'm going to say download all cs, all tabs as zip. And And I'm going to take the, function Understand the basics of functions in Google Sheets. Opens in new tab name and put it right here.<br>2:26 I'm actually going to delete the second item. We only need one item. I'm going to save it.
Now, once it's saved, I'm going to close my app script Learn how to automate tasks in Google Sheets with Apps Script. Opens in new tab .<br>2:35 I'm going to go back to my sheet and I'm going to refresh it, meaning I'm going to open it again.<br>2:38 I can close it and open it or refresh it. Once it happens up at the top next to extensions, help, now there's download csv Learn how to download your spreadsheet data as a CSV file. Opens in new tab Many new, click it.<br>2:49 And now I can click this and run it from the sheet itself. And there we go. We just created another zip file with all the CSV Understand the CSV format and how to work with it in spreadsheets. Opens in new tab files.<br>2:59 They're pretty cool, right?
And if you're a better member and watching this on better sheets, go down below and you can get this exact sheet and this code directly.<br>3:11 Download it. Enjoy it for free. If you're not watching this on better sheets, become a better sheets member today and get this code over at bettersheets.co.</div>