Sub ShowTestScript()
ActiveWorkbook.Unprotect
CCBEdit.Hide
wsTestScript.Visible = True
wsTestScript.Activate
wsTestScript.Range("A4:B25").Locked = False
wsTestScript.Range("B1").Value = CCBEdit.cboCtrlNum.Value
Query_Run "select stepno, steptext from testscripts where control = '" & CCBEdit.cboCtrlNum.Value & "'"
Query_Paste wsTestScript, "A4"
FormatRows wsTestScript.Range("A4", "B25")
ActiveWorkbook.Protect
End Sub
我的问题是解锁细胞。单步执行时,单元格在wsTestScript上解锁,但是当我运行宏时,它们被锁定。