【发布时间】:2018-07-02 14:00:52
【问题描述】:
我在使用 VBA 脚本根据其他单元格值锁定/解锁单元格时遇到 Excel 2013 崩溃问题。你能帮我找出我的 VBA 代码中的错误/错误吗!
Private Sub Worksheet_Change(ByVal Target As Range)
Unprotect "****"
On Error Resume Next
If [S9] = "Yes" Then
Unprotect "****"
[T9].Locked = False
Protect "****"
Else
Unprotect "****"
[T9].Locked = True
[T9].ClearContents
Protect "****"
End If
If [S11] = "Yes" Then
Unprotect "****"
[T11].Locked = False
Protect "****"
Else
Unprotect "****"
[T11].Locked = True
[T11].ClearContents
Protect "****"
End If
Protect "****"
End Sub
【问题讨论】:
-
添加以解决问题,但没有帮助。