sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
Good Morning,
I have a workbook that initially has four sheets, two of which are very hidden. However, almost every time the workbook is opened, a new sheet is going to be added, which will be named either "noon"/"noon#"/"Arrival" (at the end). The number of "Noons" is dynamic, sometimes there's 15 Noons (Noon, Noon2, Noon3, etc) and sometimes none. There is always one "Arrival" at the very end. The Noons and Arrival are generated and formatted via vba. I'd like to protect the sheets so the user can't delete anything- I figure this is easy as I could just add the code into the end of the macro that creates the sheet. However, I'd like to have a button on one of the hidden sheets (named "Developer") that unlocks all of the protected sheets. If the number of sheets is changing, how would I do this? My limited experience for this macro would be to record myself protecting a sheet and then cleaning up the recorded macro- but that's only good for the sheets created and not those that are not....
Thanks!
I have a workbook that initially has four sheets, two of which are very hidden. However, almost every time the workbook is opened, a new sheet is going to be added, which will be named either "noon"/"noon#"/"Arrival" (at the end). The number of "Noons" is dynamic, sometimes there's 15 Noons (Noon, Noon2, Noon3, etc) and sometimes none. There is always one "Arrival" at the very end. The Noons and Arrival are generated and formatted via vba. I'd like to protect the sheets so the user can't delete anything- I figure this is easy as I could just add the code into the end of the macro that creates the sheet. However, I'd like to have a button on one of the hidden sheets (named "Developer") that unlocks all of the protected sheets. If the number of sheets is changing, how would I do this? My limited experience for this macro would be to record myself protecting a sheet and then cleaning up the recorded macro- but that's only good for the sheets created and not those that are not....
Thanks!