加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

excel vba---添加复选框按钮控件

(2012-04-23 10:13:48)
标签:

杂谈

新建4个复选框,控制W9到W12格式的颜色

Private Sub CBox1_Change()
If CBox1.Value = True Then

Range("w9").Select
Selection.Interior.ColorIndex = 20
Else
Range("w9").Select
Selection.Interior.ColorIndex = 42
End If
End Sub

 

Private Sub CBox2_change()
If CBox2.Value = True Then

Range("w10").Select
Selection.Interior.ColorIndex = 20
Else
Range("w10").Select
Selection.Interior.ColorIndex = 42
End If

End Sub

Private Sub CBox3_change()
If CBox3.Value = True Then

Range("w11").Select
Selection.Interior.ColorIndex = 20
Else
Range("w11").Select
Selection.Interior.ColorIndex = 42
End If
End Sub

Private Sub CBox4_change()
If CBox4.Value = True Then

Range("w12").Select
Selection.Interior.ColorIndex = 20
Else
Range("w12").Select
Selection.Interior.ColorIndex = 42
End If

End Sub

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有