[英]open a sheet checkbox is checked with vba excel
In the UserForm module you can just place the following code, when your CheckBox is named "CheckBox1": 当您的CheckBox命名为“ CheckBox1”时,您可以在UserForm模块中放置以下代码:
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
Worksheets("Sheet1").Visible = True
Else
Worksheets("Sheet1").Visible = False
End If
End Sub
This will make "Sheet1" visible when it's checked and invisible when unchecked. 这将使“ Sheet1”在选中时可见,而在未选中时不可见。 If you name your checkbox differently, you'll see that if you double click the checkbox in the Userform Design, the VBE will already come up with
如果您用不同的方式命名复选框,则会看到,如果双击用户窗体设计中的复选框,则VBE将已经出现
Private Sub CheckBoxName_Click()
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.