Updated code to state of execution
This commit is contained in:
1 file changed
+6
-6
@@ -2,16 +2,15 @@ function freezeValuesExecute_(sheet) {
|
|||||||
var ss = SpreadsheetApp.getActiveSpreadsheet();
|
var ss = SpreadsheetApp.getActiveSpreadsheet();
|
||||||
var sheet = ss.getSheetByName(sheet);
|
var sheet = ss.getSheetByName(sheet);
|
||||||
var range = sheet.getRange("A:Z");
|
var range = sheet.getRange("A:Z");
|
||||||
range.copyTo(range, {contentsOnly: true});
|
range.copyTo(range, { contentsOnly: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
function freezeValues() {
|
function freezeValues() {
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
date.setMonth(date.getMonth()-1);
|
date.setMonth(date.getMonth() - 1);
|
||||||
var year = Utilities.formatDate(date, "Atlantic/Canary", "yy");
|
var year = Utilities.formatDate(date, "Atlantic/Canary", "yy");
|
||||||
var month = Utilities.formatDate(date, "Atlantic/Canary", "MMM");
|
var month = Utilities.formatDate(date, "Atlantic/Canary", "MMM");
|
||||||
var sheet = month + " " + year;
|
var sheet = month + " " + year;
|
||||||
console.log(sheet)
|
|
||||||
freezeValuesExecute_(sheet);
|
freezeValuesExecute_(sheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +19,11 @@ function doItonce() {
|
|||||||
var month;
|
var month;
|
||||||
var sheet;
|
var sheet;
|
||||||
|
|
||||||
for (let i = 0; i <= 11; i++){
|
for (let i = 0; i <= 1; i++) {
|
||||||
date.setMonth(i);
|
date.setMonth(i);
|
||||||
month = Utilities.formatDate(date, "Atlantic/Canary", "MMM");
|
month = Utilities.formatDate(date, "Atlantic/Canary", "MMM");
|
||||||
sheet = month + " 24"
|
sheet = month + " 26";
|
||||||
|
console.log(sheet);
|
||||||
freezeValuesExecute_(sheet);
|
freezeValuesExecute_(sheet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user