我有以下一段代码,它调用了几个不同的子:
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
除非我按下ctrl+shift+pageup
(或向下翻页)在我正在查看的工作表之间切换并使用下拉菜单返回工作表,否则它会很好用。
我得到一个Run-time error '1004': Unprotect method of worksheet class failed
已知的原因为什么使用切换工作表ctrl+shift+pageup
会破坏我拥有的不受保护的代码?