In the VBE
first, rename your project from the default name VBAProject to a unique
name.
then make sure it is selected in the project explorer window so it is the
active project. Then if you go to the tools menu you will have an option
MyUniqueProjectName Properties . . .
under this selection is a tab for protecting the project. Click the lock
project for viewing and assign a password.