Change new worksheet name with Copy Worksheet Google Sheets action

  • 1 April 2023
  • 0 replies
  • 239 views

I had the same issue and found out that there is no solution to that here: 


So worked with google script to achieve the purpose.

That is how you do it:

1: Go to Extensions and Add Script
2: In the script editor, paste the following code:

 

function onOpen() {
var sheet = SpreadsheetApp.getActiveSheet();
var cell = sheet.getRange("A1");
sheet.setName(cell.getValue());
}


 

  1. Save the script and give it a name if prompted.
  2. Close the script editor and return to your Google Sheet.
  3. In cell A1 of the sheet where you want to change the tab name, enter the desired name for the tab.
  4. From left hand menu select trigger and setup the trigger as per image below
  5. The tab will be renamed with the value in cell A1.
     

     

Note: This script listens to the "onOpen" trigger, which means it will run whenever anyone opens the sheet. Keep in mind that if multiple people have the sheet open at the same time, the script may not run for all of them. Also, if the value in cell A1 changes, the tab name will not update until the sheet is closed and re-opened. So you can update the value in Cell A1 from zapier and sheet will be named as that value.


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.