View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Protect Sheet Macro

Hi,

Try this

Sub sonic()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
sh.Protect Password:="MyPass"
Next
End Sub

Mike

"jrob54245" wrote:

I am trying to create a macro that will password protect the locked cells in
a spreadsheet. I can get the process to work, and the macro records, but
doesn't appear to be recording the actual process of applying the password.
In other words, I can just go in and unprotect the sheet, no password
required. Is it even possible to record the password into a macro, or does
that defeat the purpose?