How to fix error: spreadsheet.getCurrentCell().offset(-13, -8).activate();

253 views
Skip to first unread message

Sukhee Turkhuu

unread,
Jun 21, 2022, 1:26:45 PM6/21/22
to Google Ads Scripts Forum
function Mur() {
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getCurrentCell().offset(-13, -8).activate();
  var currentCell = spreadsheet.getCurrentCell();
  spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).activate();
  currentCell.activateAsCurrentCell();
  spreadsheet.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate();
  spreadsheet.getCurrentCell().offset(1, 0).activate();
  spreadsheet.getCurrentCell().offset(-114, 0, 114, 1).copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);
  spreadsheet.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate();
  spreadsheet.getCurrentCell().offset(1, 0).activate();
  currentCell = spreadsheet.getCurrentCell();
  spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.UP).activate();
  currentCell.activateAsCurrentCell();
  currentCell = spreadsheet.getCurrentCell();
  spreadsheet.getCurrentCell().offset(-229, 0, 230, 7).activate();
  spreadsheet.setCurrentCell(currentCell);
  spreadsheet.getActiveRange().createFilter();
  spreadsheet.getCurrentCell().offset(-229, 0).activate();
  spreadsheet.getActiveSheet().getFilter().sort(spreadsheet.getActiveRange().getColumn(), true);
};

Google Ads Scripts Forum Advisor

unread,
Jun 21, 2022, 1:28:46 PM6/21/22
to adwords...@googlegroups.com
Hi Sukhee,

Thanks for reaching out. Your question is related to the Apps Scripts SpreadsheetApp service, so I would recommend reaching out to their support forum. When posting on their forum, I would recommend specifying the error in your post. 

Regards,

Google Logo
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2byhkj:ref
Reply all
Reply to author
Forward
0 new messages