Looking for a Google Docs script that can automatically display only the last two rows in a spreadsheet. The goal is to have the new data added in a row and when ENTER is pressed, it will show only the latest two rows while hiding all others.
I've started with the codes below but need guidance on what to do next. Any assistance would be greatly appreciated.
function HideDone() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var test = sheet.getLastRow() - 2;
sheet.hideRows(1,test);
}