#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Protection

I have a budget sheet which allows restricted access (users without
password can only update certain cells).

I want to be able to lock the sheet/unlock the sheet using buttons. I
have tried a Macro but after the first time it only protects the sheet
without a password.

Can any one tell me how to correct this without having to go to Tools,
Protection, etc etc every time as users might forget to do this.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Protection

Private Sub SHEETPROTECT()
With ActiveSheet
.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
.EnableSelection = xlUnlockedCells
End With
End Sub

Private Sub SHEETUNPROTECT()
ActiveSheet.Unprotect Password:="justme"
End Sub

You will have to lock the project for viewing so's curious users cannot see the
code and password.


Gord Dibben MS Excel MVP

On Mon, 10 Mar 2008 08:34:35 -0700 (PDT), Paul wrote:

I have a budget sheet which allows restricted access (users without
password can only update certain cells).

I want to be able to lock the sheet/unlock the sheet using buttons. I
have tried a Macro but after the first time it only protects the sheet
without a password.

Can any one tell me how to correct this without having to go to Tools,
Protection, etc etc every time as users might forget to do this.

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
about protection pmss Excel Discussion (Misc queries) 6 January 2nd 08 02:44 PM
WS Protection: Different Levels of Protection on Different Ranges Carmi Excel Discussion (Misc queries) 4 August 31st 07 02:26 PM
protection Chi Excel Discussion (Misc queries) 7 November 9th 06 07:17 PM
Cell Protection vs. Worksheet Protection kmwhitt Excel Discussion (Misc queries) 4 September 24th 06 02:37 AM
Worksheet protection is gone and only wokbook protection can be se Eric C. Excel Discussion (Misc queries) 4 May 2nd 06 04:50 PM


All times are GMT +1. The time now is 06:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"