John, I couldn’t get your formatting code from message 171 to work:
var lastRowRange = sheet.getRange(sheet.getLastRow(), 1, 1, sheet.getLastColumn()); sheet.appendRow(newRow); lastRowRange.copyFormatToRange(sheet, 1, sheetGetLastColumn(), sheet.getLastRow(), sheet.getLastRow());
It looks perfectly fine to me relative to documentation (what do I know) but it has no effect. I have to wonder if there isn’t something larger going on, like maybe that level of functionality simply isn’t included in Google Sheets. Remember how Sheets will copy column centering for me, but not numeric formats? That’s what I mean by “level of functionality”.
Did you say it does work for you - it does copy numeric formatting? If I could back up just a little,
Can someone / anyone using this logging script do me a favor… go into your Log and change some of your number formats to something entirely bizarre. Make sure it includes the last row of data.
Like, add three more decimal places than you realistically need. Or a custom date format you’d never really want.
Then see if the next automated script output row truly copies your bizarre numeric formats for real. Or does it revert back to some default norm? That’s what it does for me.
If someone can humor me - and apologies if you’re absolutely sure you’ve already done this, John - this is a test that Google Sheets is not copying numeric formats, only for me.
Thanks very much if you can help - Mike