protecting a sheet

  • Thread starter Thread starter des-sa
  • Start date Start date
D

des-sa

please help. is it possible to password protect only one sheet in workbook?
if so, could anyone please help. can i incorporate the script into an
existing macro?
thanks
 
Try this

Sub Sonic()
'Do lots of things
Sheets("Sheet1").Protect Password:="Mypass"
End Sub

Mike
 
Sub Macro1()
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
 
From XL
Tools-Protection-Protect sheet

From VBA (w/ password)
Sub test()
Dim xPass As String
xPass = "MyPassword"
ActiveSheet.Protect Password = xPass
ActiveSheet.Unprotect Password = xPass
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top