0
votes

The problem with this function is that it also keeps selecting or activating the range that I just merged. How can I do it to activate or select the cell to the right of my merged range without the merged range still be part of the selection/activation?

function mergeColumns(){
  
var app =SpreadsheetApp;
var ss = app.getActiveSpreadsheet();
var activeSheet = ss.getActiveSheet();
var first = activeSheet.getRange(11, 61).getValue();

    activeSheet.getRange(13,3,1,first).mergeAcross();
    activeSheet.getRange(13,3,1,first).offset(0, 1).activate();

}

1
Welcome to Stack Overflow.doubleunary
An example would help a lot for people to understandCosta

1 Answers

0
votes

If you are merging four cells, the next cell will be four columns away rather than one column away.

Increase the second parameter to offset() by as many clicks as necessary to reach the next cell.