Hiding/Protecting vb code in excel

  • Thread starter Thread starter IanStrange
  • Start date Start date
I

IanStrange

Hi can anyone tell me how to either hide or protect the vb code on a
spread sheet.
Thanks
Ian
 
Ian,

1. Open the workbook that contains the VBA code
2. Activate the Visual Basic Editor by pressing Alt+F11 in Excel.
3. Tools - VBAProject Properties...
4. On the "Protection" tab, check "Lock project for viewing"
and type the same password twice in the textboxes.
5. OK
6. Save the workbook.

The VBA code will not be hidden for you at this point, but if you
switch back to Excel (Alt+F11), close and re-open the workbook,
you will see that the VBA code cannot be seen without providing the
password.

Ture Magnusson
Karlstad, Sweden
 
Back
Top