How to Lock a Check box when Clicked

2019-07-29 04:21发布

Hello I am trying to lock a check box when it is checked. So you can't un check it here is what i got. but its not seeming to work

Sub CheckBox1_Click()
If CheckBox1 = True Then
ActiveSheet.CheckBoxe1.Enabled = False
End If
End Sub

1条回答
看我几分像从前
2楼-- · 2019-07-29 05:03

Before you can disable a control that has the focus, you need to set the focus on some other control (another check box, a text field, or something else)

sub CheckBox1_Click()
    if CheckBox1 = True Then
        SomeOtherControl.setFocus
        CheckBox1.Enabled = False
    end if
end sub
查看更多
登录 后发表回答