function copyDataWithinWorkbook() {
var sourceSheetName = "Dashbord"; // Replace with the name of the source sheet
var targetSheetName = "Data"; // Replace with the name of the target sheet
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sourceSheet = spreadsheet.getSheetByName(sourceSheetName);
var targetSheet = spreadsheet.getSheetByName(targetSheetName);
var sourceRange = sourceSheet.getRange("A20:F20");
var targetRange = targetSheet.getRange("A2:F2");
targetSheet.insertRowAfter(1); // Insert a row after the 1th row in the source sheet
var sourceValues = sourceRange.getValues();
targetRange.setValues(sourceValues);
Logger.log("Data copied successfully from " + sourceSheetName + " to " + targetSheetName);
}
No comments:
Post a Comment
THANKS FOR YOUR SUPPORT