'Copy dynamic range from one sheet to another

I am using the below code to copy my data from sheet1 to sheet2 and append the data in sheet2 if script runs again? The issue is that my range is not fixed in sheet 1,I want to copy whatever range contains the content should be copied to sheet2 Can anyone guide that what to change in the below code to get the result?

  function copyInfo() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var copySheet = ss.getSheetByName("sheet1");
  var pasteSheet = ss.getSheetByName("sheet2");

  var source = copySheet.getrange(2,1,200,7);
 var destination = pasteSheet.getRange(pasteSheet.getLastRow()+1,1,200,7);

  source.copyTo(destination, {contentsOnly:true});
   var data = copySheet.getRange(2,1,200,6)  
   data.clearContent()

   }


Solution 1:[1]

Method1: Include:

var paste_lr = pasteSheet.getLastRow()

Modify:

  var source = copySheet.getrange(paste_lr+1,1,200,7);

Similarly change 200 using same function.

Method2:

var sp = PropertiesService.getScriptProperties();
var SourceLr = sp.getProperty("Source_Data_Rows") || 0;

var source = copySheet.getrange(SourceLr+1,1,200,7);

var Source_Lr = copySheet.getLastRow();
sp.setProperty("Source_Data_Rows", Source_Lr);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1