need to format columns c, e and a few others to show the date using the format below:
4 July 2014
Can't work out how to do it ... new to google script!
getRange(row, col) : returns a reference to a single cell that is at the intersection of the row and column. The code below returns a reference to the range that is a single cell at the intersection of row 3 and column C. var range = SpreadsheetApp.getActiveSheet().getRange(3,3);
To view the created files, open the [Apps Script sample] Import CSVs folder in Google Drive. Switch back to the Apps Script project and in the editor, go to the Code.gs file. In the function dropdown, select updateApplicationSheet and click Run.
To do this using Apps script, you can use the setNumberFormat(numberFormat), which lists that date formats follow the SimpleDateFormat specification.
Sample code that will do this:
function formatDate(){
var ss = SpreadsheetApp.getActive();
var sheet = ss.getActiveSheet();
sheet.getRange("A2").setNumberFormat('dd MMM yyyy');
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With