In the Visual Basic Editor, Tools > VBAProject Properties > Protection tab. Tick Lock Project for Viewing and enter a password. You will then have to save and re-open the file for the protection to take effect.
Note that Excel is not a very secure application: passwords can be cracked.