LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Protect/unprotect sheet with password with VBA?

All,

I have the following code to protect sheet, then unlock cetain cell
based on the login. So people can onlu modify certain cells. And the
protect the sheet with password, so no one can unprotect the shee
without the password:

ActiveSheet.Unprotect

Range("I4:N6").Select
Selection.Locked = False
Selection.FormulaHidden = False

ActiveSheet.Protect
ActiveSheet.Protect DrawingObjects:=True, Contents:=True
Scenarios:=True
ActiveSheet.Protect Password:="1234567"

But it doesn't work. It ask me for password.

Any suggestion will be appreciated

--
Message posted from http://www.ExcelForum.com

 
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
I need to unprotect sheet so I cn sve it but need a password? scout ron Excel Discussion (Misc queries) 2 May 28th 10 03:05 PM
Code to protect/unprotect a sheet using a macro with password FredH Excel Discussion (Misc queries) 5 October 23rd 07 04:49 PM
Forgot the password (to unprotect a sheet) Venkatesh V Excel Discussion (Misc queries) 1 March 29th 06 08:32 AM
Password - Protect, UnProtect MrAlMackay Excel Programming 5 January 19th 05 07:23 PM
VBA code - protect and unprotect a sheet Jeff Excel Programming 2 December 2nd 03 11:44 PM


All times are GMT +1. The time now is 09:02 AM.

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"