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