Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Получаем название таблицы
- * @customfunction
- */
- function имя_таблицы() {
- return SpreadsheetApp.getActive().getName();
- }
- /**
- * Выводит список листов книги и ссылок на них
- * @customfunction
- */
- function листы_книги() {
- const url = SpreadsheetApp.getActive().getUrl();
- return SpreadsheetApp.getActive().getSheets().map(g => [g.getName(), url + "#gid=" + g.getSheetId()])
- }
- /**
- * Выводим текущий лист и ссылку на него
- * @customfunction
- */
- function текущий_лист() {
- const ss = SpreadsheetApp.getActive();
- const sh = SpreadsheetApp.getActiveSheet();
- return [[sh.getName(), ss.getUrl() + "#gid=" + sh.getSheetId()]];
- }
- /**
- * Выводим листы и диапазоны
- * @customfunction
- */
- function листы_диапазоны() {
- return [['Лист', 'Диапазон с данными', 'Границы листа']].concat(SpreadsheetApp.getActive().getSheets()
- .map(g => [g.getName(), g.getDataRange().getA1Notation(), g.getRange(1, 1, g.getMaxRows(), g.getMaxColumns()).getA1Notation()]))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement