I'm creating a workout spreadsheet to track my performance week-to-week, with each sheet covering a week's worth of workouts. Each sheet (aside from the first) is a duplicate of the sheet before it, and there are some values I'd like to carry over from the previous sheet; for instance, the number of reps for an exercise from the previous week.
I've read through some of the API but can't seem to find a function that selects the current sheet where the function is called from. If it existed, I could get the index and subtract from it to get the previous sheet, then grab a value from a given row and column. However, the closest thing I can find is accessing the "Active" sheet - something that seems to be set using the setActiveSheet() function. But I don't see how I can use this in a single script meant to be used in multiple different cells.
Am I missing something here, or is there a better way to grab information about the currently-selected sheet? Any help you can provide would be very helpful. Thank you!
[EDIT] My spreadsheet is located here: https://docs.google.com/spreadsheets/d/1b8rDYxbb_6ltI0GvKcmKyz1Y3IV3BSrgWp8Mf2l18cc/edit?usp=sharing
Additionally, I will post the script below.