Results 1 to 7 of 7

Exclude a specific sheet on onEdit function [Google Apps Script]

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Exclude a specific sheet on onEdit function [Google Apps Script]

    Hi Experts,

    I know this is Excel Forum but i am hoping someone could help.

    I am using this script to update the sheet name:

    function onEdit(){ 
    
    // Get Active Spreadsheet
      var sheet = SpreadsheetApp.getActiveSheet();
    
    // Get Active Spreadsheet Name
      var oldName = sheet.getName();
    
    // Get value in cell G1 of active spreadsheet and rename sheet using value in cell G1 plus "VL"
      var newName = sheet.getRange(1,7).getValue();
      if (newName.toString().length>0 && newName !== oldName) {
        sheet.setName(newName + " [VL]");
      }
    }
    Question: How do I exclude a specific sheet (ex. Data Sheet) so that it won't be renamed in case I have to change the value in cell G1 of the Data Sheet?


    Thank you,
    Last edited by bhenlee; 02-10-2023 at 02:35 AM.
    If I've helped U pls click on d *Add Reputation

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Exclude a specific sheet on onEdit function
    By bhenlee in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 02-09-2023, 11:21 PM
  2. need a little change in google apps script for saving data permanently
    By akshay6s in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 8
    Last Post: 12-30-2021, 09:27 AM
  3. need a little change in google apps script for saving data permanently
    By akshay6s in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2021, 08:07 AM
  4. Convert VBA to Google Apps Script
    By B_H in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2021, 04:39 AM
  5. Google Sheets onEdit Script Failing On Mobile
    By swordswinger710 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 10-11-2019, 12:21 PM
  6. [SOLVED] Auto-populate a cell with a date today [Google Apps Script]
    By Kotasyon in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 5
    Last Post: 10-09-2019, 04:07 AM
  7. Google Apps Script for Google Sheets Pulling Formulas from Master to Several Slave Sheets
    By excelroofing in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 08-22-2018, 02:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1