Javascript in Google Sheets script: help using setNumberFormat

前端 未结 1 489
死守一世寂寞
死守一世寂寞 2021-01-16 03:53

Hoping this is a simple problem for you lot. I have no coding knowledge at all. But been using the below script in a Google Sheet to grab changing data from another sheet an

相关标签:
1条回答
  • 2021-01-16 04:20

    To specify the format for a specific cell

    var cell = sheet.getRange("A2");
    cell.setNumberFormat("dd/MM/yyyy");
    

    To specify the format for a range of cells

    var cells = sheet.getRange("A2:C2");
    cells.setNumberFormat("dd/MM/yyyy");
    

    Please see the documentation for Range and formats.

    0 讨论(0)
提交回复
热议问题