Code With Mark
Home
About
Resources
Contact

Easily Create Multiple Google Sheets In 5 Seconds

This is the fastest way to create multiple google sheets from a google sheet template.

Get the code:

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Or DocumentApp or FormApp.
  ui.createMenu('Clone Menu')
      .addItem('Clone Sheet', 'cloneGoogleSheet')
      .addSeparator()      
      .addToUi();
}

function cloneGoogleSheet() {

  var source = SpreadsheetApp.getActiveSpreadsheet();
  
  var sheet = source.getSheetByName('Sheet1');

  //get sheet names
  var ss_names = source.getSheetByName('SheetNames');
  var ss_last_row = ss_names.getLastRow();
 
  console.log('Row ' + ss_last_row );

  for (let i = 0; i < ss_last_row; i++) 
  {   
    var row_id = i+1;
    var get_sheet_name = ss_names.getRange("A"+ row_id).getValue();

    console.log(get_sheet_name);

    
    var old = source.getSheetByName(get_sheet_name);
    if (old) source.deleteSheet(old); // or old.setName(new Name);

    
    if(get_sheet_name != "Names")
    {
      sheet.copyTo(source).setName(get_sheet_name);
    }
  }
  

}
For Web Developers

Your Next Project Could Make You Money for Years

Most web developers get paid once for the work they do.

But what if you could use those same skills to build something that continues generating income long after it's launched?

A simple SaaS, plugin, web app, or digital product can keep bringing in customers and revenue month after month.

Instead of starting from zero with every new client project, you can create assets that work for you—even when you're not.

Learn How To Build Monthly Income →
Best Way To Create Single Page ApplicationsBest Way To Create Single Page Applications←Previous
Create Website With Google SheetCreate Website With Google SheetNext→

Related Posts

  • GOOGLE SHEETS HACK That Creates Files Automatically
  • How Google Developers Think (And Why You Should Too)
  • Add Google Sign-In in 2 Minutes

Top Posts Viewed

Google Sheets Timesheet Website App Script
2.09K views
Learn To Create YouTube Video Downloader
1.71K views
Easily Edit HTML Table Rows Or Cells With jQuery
1.38K views

Categories

Courses
Excel
Google Script
Javascript
jQuery
Microsoft Access
MongoDB
Node JS
PHP
Quick Tip
Uncategorized
Wordpress