After the result of Checkbox to Paste by last row in Column D would like to attempt to do the same though for last column in a row.
The following script put together using Google Developers - copyTo(destination, options):
function onEdit(event) {
  // assumes source data in sheet named main
  // target sheet of move to named Completed
  // getColumn with check-boxes is currently set to column 4 or D
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var s = event.source.getActiveSheet();
  var r = event.source.getActiveRange();
  if(s.getName() == "Sh1" && r.getColumn() == 2 && r.getValue() == true) {
    var rangeToCopy = s.getRange(4, 2, s.getMaxRows(), 2);
    rangeToCopy.copyTo(s.getRange(4, 5), {contentsOnly:true});
  }
}
.
Is there a way to have the same checkbox copy the maxRows (depending on the results in B4:C14) and paste them in the next available section as shown below for 2nd and 3rd Paste (etc):

.
.
Have tried to alter the formula provided in Checkbox to Paste by last row in Column D but have not been able to.
The Sample Sheet
Thank you
