I need to setup a macro that will set the password as the sheet name. Here is my "simplistic" code to do this:
Sub ProtectSheetBack()
'
' ProtectSheetBack Macro
'
' Keyboard Shortcut: Ctrl+p
'
Dim sht As Worksheet
Dim Pswrd As String
For Each sht In ActiveWorkbook.Worksheets
Pswrd = sht.Name
sht.Protect Paswrd
Next sht
End Sub
The sht.Protect Paswrd is not working correctly. May I please have some assistance?
thanks!
nanc
Sub ProtectSheetBack()
'
' ProtectSheetBack Macro
'
' Keyboard Shortcut: Ctrl+p
'
Dim sht As Worksheet
Dim Pswrd As String
For Each sht In ActiveWorkbook.Worksheets
Pswrd = sht.Name
sht.Protect Paswrd
Next sht
End Sub
The sht.Protect Paswrd is not working correctly. May I please have some assistance?
thanks!
nanc