Marco to protect / unprotect worksheet

O

ordnance1

How can I edit the code below to enter the password snow (I use a password on
the protected sheet to keep people from makeing unwanted changes)

Also I need code to reprotect the worksheet at the end addining the password
snow.

Sub Macro1()
'
' Macro1 Macro
'

'
ActiveSheet.Unprotect
End Sub
 
M

Mike H

Sub Macro1()
ActiveSheet.Unprotect password:="snow"
End Sub

Note snow is case sensitive
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
G

Gord Dibben

Sub UnProtect()

ActiveSheet.UnProtect Password:="snow"

Run some code to do things and when complete reprotect

ActiveSheet.Protect Password:="snow"

End Sub


Gord Dibben MS Excel MVP
 

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

Top