Adds a new sheet tab to the spreadsheet.
class SpreadsheetApp method .insertSheet()
SpreadsheetApp is the Apps Script service.
.insertSheet() is the method name you will see after a dot in your code.
What it does
Why it's used
- Add a new tab for this week's report without manual clicking.
- Create a scratch sheet for imports before merging into the main data.
Common errors
- Forgetting parentheses on insertSheet. Write SpreadsheetApp.insertSheet(), not SpreadsheetApp.insertSheet or insertSheet by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').insertSheet().
- Adding spaces where they do not belong. Write SpreadsheetApp.insertSheet(), not SpreadsheetApp .insertSheet(), SpreadsheetApp.insertSheet (), or SpreadsheetApp . insertSheet().
- Wrong capitalization. Use SpreadsheetApp and insertSheet, not spreadsheetapp or insertsheet.
Explore
Related methods
-
.deleteSheet()
Removes a sheet tab from the spreadsheet.
-
.appendRow()
Adds a new row of data at the bottom of the sheet.
-
.getSheets()
Returns every sheet tab in the spreadsheet.
-
.getSheetByName()
Finds a sheet tab by its name.
-
.activate()
Makes a sheet or range the active selection.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about SpreadsheetApp.insertSheet().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →Get Sheet Done: Start Your Business in Sheets
4 Ways Google Sheets Can Help You Start Up Create a list Curate Links Track Something Write Code
Read post →