+ Reply to Thread
Results 1 to 1 of 1

Script to create / rename a sheet

  1. #1
    Forum Contributor
    Join Date
    04-27-2014
    Location
    england
    MS-Off Ver
    excel 2003,2016 and google sheets
    Posts
    124

    Script to create / rename a sheet

    hey i found the following script to make a copy of the active spread sheet, and rename it
    This is for google drive

    function CreateNewTimesheet() {

    // The code below makes a duplicate of the active sheet
    var ss = SpreadsheetApp.getActiveSpreadsheet()
    SpreadsheetApp.getActiveSpreadsheet().duplicateActiveSheet();

    // The code below will rename the active sheet value of cell c5
    var myValue = SpreadsheetApp.getActiveSheet( ).getRange("C5").getValue();
    SpreadsheetApp.getActiveSpreadsheet().renameActiveSheet(myValue);

    how can i make it make a copy of a sheet name as apose to the active sheet, for example i got 4 sheets, sheet1, sheet2, sheet3,sheet4 and i want it to make a copy of sheet3 not the active sheet, then rename that sheet to sheet2 cell C1 value.

    Thanks for any help.
    Last edited by Ditch1983; 01-20-2015 at 07:37 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Create A Copy To A New Sheet & Rename Sheet Based on Cell Value
    By delicard in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-25-2013, 08:56 PM
  2. Create a New Sheet & Rename it Based on Cell Value on Another Sheet
    By delicard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2013, 04:48 PM
  3. Create New Sheet and Rename
    By monkeynoon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2013, 04:57 PM
  4. Macro to create sheet, rename sheet, and hyperlink to it
    By prescottfarm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2013, 04:46 PM
  5. Script Looping and will not rename my sheet
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2008, 05:48 PM

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