View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RadarEye RadarEye is offline
external usenet poster
 
Posts: 78
Default Macro + protection

Hi E,

It is quite simple.
In your macro:
as first line of code use: ActiveSheet.Unprotect("MyPassword")
as last line of code use: ActiveSheet.Protect

If the Project window is not visible hit [Ctrl]+[R]
Next rightclick in the project window on the project you are editing
Select VBAProject properties
Goto tab "Protection"
Check "Lock project for viewing"
Enter and Confirm a password, ideally an other password as used for
protecting the sheet.

HTH,

Wouter