I have a document saved on SharePoint that documents testing.
Once testing has been completed I would like to move the tests (entire row) to a separate sheet to archive the test schedule, in the next empty row going down, and because its now archived delete it from the submission sheet.
Both sheets are within the same workbook. The number of rows differ each time the script is run therefore the script code would need to work based on a selection input by the user (either prior to running the script or prompted by the script).
I managed this in VBA. I can't locate a viable alternative to the selection function. Is there any way of translating the below VBA code to Office script so the same thing happens in Excel online?
Sub MoveCompletedTests()
Selection.Copy Sheets("Archive - ATL staff only").Range("A1048576").End(xlUp).Offset(1, 0)
Selection.Delete
End Sub
I have a button on the "Sample submission" sheet that runs the above code on the selected range on that sheet moving it to the "Archive - ATL staff only" sheet.
I attempted to use the script recorder but the script didn't allow for the selection to be dynamic enough, it coded for the cell range rather than just selection.