Zend certified PHP/Magento developer

Excel Online (365): Script to adjust unlocked range [closed]

I have a workbook in the online version of excel with multiple data sheets. Colleagues from different units go into the sheet every morning and enter data for the current date and the week to date. Then, after the updates are done (by a specific time) I need to go in and adjust the unlocked range so that the current days data is “locked in” and the next day is available for tomorrow.

I was hoping to build a power automate flow to do this for me, but have no idea where to even start as far as writing a script to adjust the unlocked range.

The workbook has a password, and the unlocked range has a separate password

The range starts with B2:E8 (B2 is the week to date and B4:B8 are monday-friday)
The script would need to change the range to be B2:B8 and C2:E8 on the first run
then go to B2:B8 and D2:E8, etc etc, removing a row from the bottom half each time

ideally, after it is B2:B8 and E2:E8, it would take the next 6 rows B9:E14, etc

Also, from what I’ve seen, the script would need to unprotect the sheet using a password and then reprotect it with the same password

Is this even possible? anyone able to provide a script that would do this?