Excel Help - Sheet protection

Ronin207
03-30-2003, 08:58 AM
The purpose of my spreadsheet is to distribute it to other to use with out making modifications to formulas or even to see background code.

1. protect the sheet -

I'm trying to protect the my worksheets from being modified except for several cell that the user must input. :D

The worksheet also has code behind it to run calculation and display results in some of the "protected" cells.

The problem is that when you lock the worksheet, it stops the code's ability to change those cells also.

is there a way that i can protect the worksheet but allow for the excel code to change protected cells?

2. Hide the VBA code from VBA editor -

How is this accomplished?

Any help would be greatly appreciated.

italkid
03-30-2003, 05:11 PM
To protect and unprotect your sheet.

Private Sub CommandButton1_Click()
Dim Password

Password = "Ronin207"

ActiveSheet.Unprotect Password
'Your code
ActiveSheet.Protect Password, Structure:=True, Windows:=False


For question 2
Go in the VB editor to > project properties en look for the security tab.
There you can add a password to protect your code.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum