ChristineJ
Well-known Member
- Joined
- May 18, 2009
- Messages
- 771
- Office Version
- 365
- Platform
- Windows
I'm using this code in Office Scripts so that cell E15 is not locked when the sheet is protected.
selectedSheet.getRange("E15").getFormat().getProtection().setLocked(false);
Cell B2 contains a text string that includes numbers, such as CJJS621597.
I'd like to update the Script so that cell E15 is set to unlocked only if the 7th character in the string in B2 is a 1 (possibly incorporating something like MID($B$2,7,1)="1" into the script?)
Can that be done? Thanks!
selectedSheet.getRange("E15").getFormat().getProtection().setLocked(false);
Cell B2 contains a text string that includes numbers, such as CJJS621597.
I'd like to update the Script so that cell E15 is set to unlocked only if the 7th character in the string in B2 is a 1 (possibly incorporating something like MID($B$2,7,1)="1" into the script?)
Can that be done? Thanks!