--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/5262961a-07ca-4bb9-9dce-b94c39c3b8c6n%40googlegroups.com.
/** @OnlyCurrentDoc */
function Datasort() {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
var conditionalFormatRules = spreadsheet.getActiveSheet().getConditionalFormatRules();
conditionalFormatRules.push(SpreadsheetApp.newConditionalFormatRule()
.setRanges([spreadsheet.getRange('A2:A104')])
.whenNumberGreaterThan(44253.9999884259)
.setBackground('#FFFF00')
.build());
spreadsheet.getActiveSheet().setConditionalFormatRules(conditionalFormatRules);
sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()).activate();
spreadsheet.getActiveRange().offset(1, 0, spreadsheet.getActiveRange().getNumRows() - 1).sort({column: 4, ascending: true});
spreadsheet.getActiveRange().offset(1, 0, spreadsheet.getActiveRange().getNumRows() - 1).sort([{column: 4, ascending: true}, {column: 5, ascending: true}]);
spreadsheet.getRange('A2').activate();
};
Thank you for your assistance.
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/ZhNHOwXYxbk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAKTLZ51D3zsX%2B%3Drxed8QTdoOZdybg1XmTPAO-FjxGEFL-BJmjg%40mail.gmail.com.
.whenDateAfter(SpreadsheetApp.RelativeDate.TODAY)
and if you do .setRanges([spreadsheet.getRange('A2:A')])
You cover the whole column and don't need to update.
you don't have to keep adding this condition (ie once you set this condition correct it should work for every future submission as well)
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CABUeSM1UaDMGdn_fxaFZixqEqA_sHOWG9Qe1keD_7sxCuSP-GQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/412301bb-4e08-4b39-b9f5-9d2e9c3aa87en%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CACK38a7UZd%3DzqbrUBP6gy-oUvx%2BrG5W%3Dby0bt3dqXES4BPXAxQ%40mail.gmail.com.