Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8722899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:30:27+00:00 2026-06-13T07:30:27+00:00

How to divide a google spreadsheet (with about 100 sheets) in two (or more)

  • 0

How to divide a google spreadsheet (with about 100 sheets) in two (or more) spreadsheets (of about 50 sheets each) in google-apps-script ?

Alas, due to a google bug (see https://productforums.google.com/d/topic/docs/H2ZakBguOgk/discussion), I can’t copy the entire spreadsheet file and delete some sheets in each spreadsheets.

I can only copy sheets one by one on another spreadsheet, then delete the original sheet(s) if copy is a success.

Thanks in advance 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:30:28+00:00Added an answer on June 13, 2026 at 7:30 am

    Here is a code snippet that should do what you want, I didn’t test it so maybe you’ll have to tweak some details but the general idea is there…

    EDIT : I tested and made the corrections to make it work… sorry for the typos in first version

    function splitSS() {
    var oldFileID = 'original ss Id'
    var newFile = DocsList.getFileById(oldFileID).makeCopy()
    var newFileID = newFile.getId()
    var ss = SpreadsheetApp.openById(newFileID);
    Logger.log(ss.getNumSheets())
    var todel = parseInt((ss.getNumSheets())/2);
    Logger.log(todel)
    var tokeep = ss.getNumSheets()-todel
    Logger.log(tokeep)
        for (pa=ss.getNumSheets()-1;pa>tokeep;--pa){ 
          ss.setActiveSheet(ss.getSheets()[pa]);
          var delsheet = ss.deleteActiveSheet(); // delete sheets begining with the last one
          Utilities.sleep(400);
        }
    var ssold = SpreadsheetApp.openById(oldFileID);
        for (pa=todel;pa>1;--pa){ 
          ssold.setActiveSheet(ssold.getSheets()[pa]);
          var delsheet = ssold.deleteActiveSheet(); // delete sheets begining with the last one
          Utilities.sleep(400);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm including the Google Analytics Script divided into 2 pierces of Javascript code: google-analytics.js:
I divide dynamic websites into two types: The first one use e.g PHP ,
I want to divide the Google map display into 200 parts , I have
So I am pulling information from google calendar and I need to divide the
How do I divide a large positive integer n into m parts uniformly randomly
I want to divide a number of type double, by an int. I only
I want to divide my window (wpf) in three columns: left column must be
How can I divide a sentence like He and his brother playing football. into
I wan't to divide my CI into multiple applications. I should say that it
Write a NASM macro: divide, which has 2 arguments, which specify unsigned integers in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.