SQLTeam.com | Weblogs | Forums

SQL that copies and pastes data in a database that changes

Good Morning,

I have programmed a SQL coding that copy "z" data under the "a" data but the number "a" rows can change (It finishes row number 16 in my example below but it can finish row number 25)
I have added below the coding that I had programed
Can you change my coding in order to include the change that I want to carry out ?

Thanks for your help

function azerty() {

  • var spreadsheet = SpreadsheetApp.getActive();*
  • spreadsheet.getRange('L5').activate();*
  • var currentCell = spreadsheet.getCurrentCell();*
  • spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.NEXT).activate();*
  • currentCell.activateAsCurrentCell();*
  • currentCell = spreadsheet.getCurrentCell();*
  • spreadsheet.getSelection().getNextDataRange(SpreadsheetApp.Direction.DOWN).activate();*
  • currentCell.activateAsCurrentCell();*
  • spreadsheet.getRange('D11').activate();*
  • spreadsheet.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate();*
  • spreadsheet.getRange('L5:Q10').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);*
    };