Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default protect sheet with password

i got a macro to protect my sheet and then navigate me to another sheet.

i need this macro to protect the sheet with a password and then i need
another macro to unprotect the password protected sheet.

this is what im using now

Sub data()

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.MoveAfterReturnDirection = xlToRight
Sheets("data").Select
Range("A111").Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default protect sheet with password

Possibly

Sub data()
ActiveSheet.Protect Password:="mypass"
Sheets("data").Select
Range("A111").Select
End Sub

Sub data1()
Sheets("Sheet1").Unprotect Password:="mypass"
Sheets("sheet1").Select
Range("A111").Select
End Sub



Mike


"pswanie" wrote:

i got a macro to protect my sheet and then navigate me to another sheet.

i need this macro to protect the sheet with a password and then i need
another macro to unprotect the password protected sheet.

this is what im using now

Sub data()

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.MoveAfterReturnDirection = xlToRight
Sheets("data").Select
Range("A111").Select
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default protect sheet with password

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

Sub SHEETUNPROTECT()
ActiveSheet.Unprotect Password:="justme"
Application.MoveAfterReturnDirection = xlDown
End Sub


Gord Dibben MS Excel MVP

On Sun, 30 Dec 2007 00:31:00 -0800, pswanie
wrote:

i got a macro to protect my sheet and then navigate me to another sheet.

i need this macro to protect the sheet with a password and then i need
another macro to unprotect the password protected sheet.

this is what im using now

Sub data()

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.MoveAfterReturnDirection = xlToRight
Sheets("data").Select
Range("A111").Select
End Sub


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
password protect a sheet Joe Excel Discussion (Misc queries) 5 October 27th 08 11:14 PM
password protect a single sheet Brian Excel Discussion (Misc queries) 4 September 16th 08 08:19 PM
Protect sheet without password? EllenM Excel Discussion (Misc queries) 2 June 21st 07 03:22 PM
Password Protect a Sheet Lynn Excel Discussion (Misc queries) 1 October 27th 06 03:41 PM
Protect Sheet with password through VBA bill_morgan_3333 Excel Programming 2 December 24th 04 04:03 AM


All times are GMT +1. The time now is 01:55 PM.

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

About Us

"It's about Microsoft Excel"