Google Sheets - Copy entire row at the active cell and paste below at active cell in a macro.
Simple to insert line below active cell.
function mcrPackagedPart() {
var spreadsheet = SpreadsheetApp.getActive();
var activeRow = spreadsheet.getActiveCell().getRow();
var activeRange = spreadsheet.getRange("A"+activeRow+":Z"+activeRow).getValues();
// test
spreadsheet.getRange(activeRange).activate();
spreadsheet.getActiveSheet().insertRowsAfter(spreadsheet.getActiveRange().getLastRow(), 1);
spreadsheet.getActiveRange().offset(spreadsheet.getActiveRange().getNumRows(), 0, 1, spreadsheet.getActiveRange().getNumColumns()).activate();
spreadsheet.getRange(activeRange).copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);
};
It's very likely that you already found the Macro recording feature of Google Sheets because the code on the question.
While this feature could be useful, in order to be able to improve the recorded macro you should spend some time to learn the basics of JavaScript, Apps Script and the Spreadsheet Service. If you didn't this yet please read https://developers.google.com/apps-script/guides/sheets
The following show how could look the macros.gs file with an edited macro to keep the minimum required lines to insert a row above of the active cell:
/** @OnlyCurrentDoc */
function myFunction() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getActiveSheet().insertRowsBefore(spreadsheet.getActiveRange().getRow(), 1);
};