Google script to copy and rename a sheet and name is based on a cell reference

后端 未结 3 1732
名媛妹妹
名媛妹妹 2020-12-11 04:17

I\'m new to google scripts and I need to copy the current active sheet to a new sheet and then rename this sheet based on a cell value. My issue is the cell value is a date

3条回答
  •  暖寄归人
    2020-12-11 04:58

    Just using .getDisplayValue() in place of .getValue() in your code should do the trick.

    It gets the value displayed in the cell as a string, taking into account things like date formatting, so when you then use that to rename your sheet the sheet name will be the same as what you see in your cell.

提交回复
热议问题