Foodinder/Recorded Macros (Baza danych Foodinder).gs

62 lines
3.0 KiB
Plaintext
Raw Normal View History

2019-12-16 17:20:37 +01:00
/** @OnlyCurrentDoc */
function green() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('E28').activate();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Uzytkownik+sesja) - dopasowania'), true);
spreadsheet.getRange('E3').activate();
spreadsheet.getRange('E4:P4').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
history();
nodups();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Interfejs + Logi uzytkownika)'), true);
};
function red() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('E28').activate();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Uzytkownik+sesja) - dopasowania'), true);
spreadsheet.getRange('E3').activate();
spreadsheet.getRange('E5:P5').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
history();
nodups();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Interfejs + Logi uzytkownika)'), true);
};
function history() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Interfejs + Logi uzytkownika)'), true);
spreadsheet.getRange('N10').activate();
spreadsheet.getRange('N9:Q41').moveTo(spreadsheet.getActiveRange());
spreadsheet.getRange('N9').activate();
spreadsheet.getRange('B10:E10').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
};
function nodups(){
//spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Uzytkownik+sesja) - dopasowania'), true);
var spreadsheet = SpreadsheetApp.getActive();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var koordynaty = spreadsheet.getRange('(Interfejs + Logi uzytkownika)!C12').getValue();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Uzytkownik+sesja) - dopasowania'), true);
var sheet = ss.getSheetByName('(Uzytkownik+sesja) - dopasowania');
sheet.getRange(koordynaty,2).setValue('x');
};
function restart() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Interfejs + Logi uzytkownika)'), true);
spreadsheet.getRange('N9:Q').activate();
spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).activate();
spreadsheet.getActiveRangeList().clear({contentsOnly: true, skipFilteredRows: true});
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Uzytkownik+sesja) - dopasowania'), true);
spreadsheet.getRange('G3').activate();
spreadsheet.getRange('G2:R2').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);
spreadsheet.getRange('B12:B').activate();
var currentCell = spreadsheet.getCurrentCell();
spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).activate();
spreadsheet.getActiveRangeList().clear({contentsOnly: true, skipFilteredRows: true});
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('(Interfejs + Logi uzytkownika)'), true);
};