Hiding VB Code

  • Thread starter Thread starter johnsail
  • Start date Start date
J

johnsail

How do you hide the VB code from users?
My sheet is protected but when you right click on the sheet tab and select
View, you can see all the code - including the password that is "protecting"
the sheet.

John
 
Password protect the VBA project, Tools>Project Properties>Protection

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
At the top of the module put
Option private module
and they can't see it from tools>macros
Also, protect the macro project to deny access to most people.
 
Hi Don

Don't understand what you mean here. Can you explain a bit further please.

John
 
When you set a password on VBAProject>Protection> "lock for viewing" you
must save and close the workbook.

When you re-open, the protection is functional.


Gord Dibben MS Excel MVP
 
Pretty simple..type option private module as the top line in the module. Same as typing
private sub thissub() for each

Now goto tools>macros>macros and you will not see your macros anymore.
To work in the module comment out the line and then uncomment when through
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top