Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code - protect and unprotect a sheet
Can someone please provide code to protect and unprotect a
sheet. Assume sheet name is "Sam" and password is "Malone". Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code - protect and unprotect a sheet
"Jeff" schreef in bericht ... Can someone please provide code to protect and unprotect a sheet. Assume sheet name is "Sam" and password is "Malone". Thanks. Sheets("Sam").Unprotect password:="Malone" Sheets("Sam").protect password:="Malone" |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code - protect and unprotect a sheet
Sub Protect()
Sheets("Sam").Protect Password:="Malone" End Sub --------------------------------------------- Sub UnProtect() Sheets("Sam").UnProtect Password:="Malone" End Sub --------------------------------------------- If you just want a routine to toggle it, then the following from JE McGimpsey will do that:- Sub ToggleProtect() Const PW As String = "Malone" With Sheets("Sam") If .ProtectContents = False Then .Protect PW Else .UnProtect PW End If End With End Sub -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 00/02/03 ---------------------------------------------------------------------------- Newsgroups - Where you really can get a free lunch!! ---------------------------------------------------------------------------- "Jeff" wrote in message ... Can someone please provide code to protect and unprotect a sheet. Assume sheet name is "Sam" and password is "Malone". Thanks. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect, unprotect | Excel Discussion (Misc queries) | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
Protect - Unprotect Sheet - Visual Source Safe | Excel Discussion (Misc queries) | |||
Code to protect sheet | Excel Worksheet Functions | |||
unprotect sheet in code and make sheet visible | Excel Programming |