Sep 01 2020 04:51 AM
Hi
I am trying to allow ungrouping in a protected worksheet however when saving and reopening the workbook and click to ungroup it is saying that i cannot do this on a locked worksheet. All the codes i have tried don't work.
Sep 01 2020 06:04 AM
Unprotect the sheet at the beginning of the macro, then protect it again at the end. For example:
Sub MyUngroup()
ActiveSheet.Unprotect Password:="secret"
' Your code to ungroup data
...
ActiveSheet.Protect Password:="secret"
End Sub
Replace secret with the password that you used to protect the worksheet. If you didn't specify a password, use "" or omit the Password:=... part.