gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
How can I lock certain sheets in a workbook when the workbook opens
- User
How can I lock certain sheets in a workbook when the workbook opens
- Assistant
To lock certain sheets in a workbook when the workbook opens, you can follow these steps:
- Open Excel and the workbook that you want to lock certain sheets in.
- Press
Alt + F11to open the Visual Basic for Applications (VBA) editor. - In the VBA editor, find the Project Explorer window on the left-hand side (if it's not visible, you can enable it by pressing
Ctrl + R). - Expand the workbook by clicking on the "+" icon next to its name.
- Double-click on the "ThisWorkbook" module, which is located under the workbook's name.
- In the code window that opens, paste the following code:
code