Sometime back we wrote a blog post explaining how to password protect excel workbook. Few of our readers wrote us a query that they don’t want to password protect the entire workbook but only the VBA code so that no one can edit it. So we thought it would be a good idea to share the steps to password protect the VBA Code with rest of our readers also.
Step 1: To make VBA code password protected, launch the VB Editor (Alt+F11) and select the project in the Project Explorer window.
Step 2: Choose Tools -> VBAProject Properties as shown in the figure below:
Enable the “Lock project for Viewing” check box and enter a password twice. Click OK and then save your file.
Hope you find the information presented here useful. Feel free to leave your queries or feedback in the comments section below.