Hi,
I am trying to protect a worksheet, but still enable the "Group/Ungroup" functionality to work. I've managed to source the code for this from another forum - Code below:
Sub ProtectAll()
Dim ws As Worksheet
sSheet = "Sheet7"
For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case sSheet7
Case Else
ws.Protect Password:="PASSWORD", userinterfaceonly:=True
ws.EnableOutlining = True
End Select
Next ws
End Sub
My issue now is that I am trying to change the password to Null so used the code:
ws.Protect Password:=Null, userinterfaceonly:=True
But unfortunately when I try to unprotect the wsheet using the blank password, it returns the message that the Password supplied is not correct. I am a newbie VBA user, so could do with some advice on how to correct this so that the worksheet is protected with a blank password.
Many thanks to anyone who can help.
I am trying to protect a worksheet, but still enable the "Group/Ungroup" functionality to work. I've managed to source the code for this from another forum - Code below:
Sub ProtectAll()
Dim ws As Worksheet
sSheet = "Sheet7"
For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case sSheet7
Case Else
ws.Protect Password:="PASSWORD", userinterfaceonly:=True
ws.EnableOutlining = True
End Select
Next ws
End Sub
My issue now is that I am trying to change the password to Null so used the code:
ws.Protect Password:=Null, userinterfaceonly:=True
But unfortunately when I try to unprotect the wsheet using the blank password, it returns the message that the Password supplied is not correct. I am a newbie VBA user, so could do with some advice on how to correct this so that the worksheet is protected with a blank password.
Many thanks to anyone who can help.