I have the following piece of code which calls a few different subs:
Sub DropDown2_Change()
'Packtype/Brand-packtype change
Sheets("planning interface").unprotect
Application.ScreenUpdating = False
Call clear_data
If Sheets("load").range("Q1") = True Then
packtypeform.Show
End If
If Sheets("load").range("Q1") = False Then
brandpacktypeform.Show
End If
Call formatting
With Sheets("planning interface")
.Protect
.EnableSelection = xlUnlockedCells
End With
application.screenupdating = true
End Sub
It works great unless I press ctrl+shift+pageup
(or pagedown) to switch between sheets I am viewing and return to the sheet with the dropdown.
I get a Run-time error '1004': Unprotect method of worksheet class failed
Is there a known reason why switching sheets using ctrl+shift+pageup
would break the unprotect code that i have?