Hi everyone,
I have a macro that is hiding/showing certain rows, which is activated by a Toggle Button.
However, the sheet on which this is set is protected.
My problem is the following:
When clicking the button, Excel will show the "sheet is protected"-dialogue, you would also get when trying to manually enter data in a protected sheet, even though I use Sheet.Unprotect in the macro before anything is changed on the sheet.
Putting the Sheet.Unprotect as the first line in the Button_Click Event or using Application.DisplayAlerts also doesn't help.
Funnily enough, the macro still works. The sheet gets unprotected, the rows are hidden and the sheet is protected again, but as I said the dialogue always shows.
I don't really mind that, but since others are using the file and they don't know that everything is fine, when the warning shows, I would like to fix this.
Currently my code looks like this:
The sheet is unprotected in the called Sub before anything is changed on the sheet. But as mentioned, putting the unprotect line first in the Click event does not help either.
I would be happy to hear you guys' thought on this
Bookmarks