[ XsXJ6yyt.rar (13.72 KB, 下载次数: 16) 2010-3-8 21:07 上传 点击文件名下载附件 [求助]我想修改一段VB,对我来说太难了,单元格区间内鼠标点件事件 各位老师,需求写在上传的附件中,里面有蓝桥老师曾经写的VB,测试成功了的,现在我想移植到[C]中,请问怎么改。谢谢。 [此贴子已经被作者于2010-3-11 23:52:12编辑过] 最佳答案 月排行榜 / 总排行榜 amulee 2010-3-11 13:48 这样?Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Target.Row <> 18 Then Exit Sub If Target.Column < 6 Or Target.Column > 35 Then Exit Sub Dim iNum%, iCol% iNum = (Target.Column - 6) Mod 10 iCol = (Target.Column - 6) \ 10 + 3 If Len(Cells(18, iCol)) = 0 Then Target.Interior.ColorIndex = 56 Cells(18, iCol) = iNum ElseIf Cells(18, iCol) <> iNum Then MsgBox "已经选择该位的数字,请重新选择" Else Target.Interior.ColorIndex = 0 Cells(18, iCol).ClearContents End IfEnd Sub 跳转到最佳答案楼层
各位老师,需求写在上传的附件中,里面有蓝桥老师曾经写的VB,测试成功了的,现在我想移植到[C]中,请问怎么改。谢谢。
这样?
使用道具 举报
求助。。
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )
GMT+8, 2024-5-17 00:31 , Processed in 0.272032 second(s), 10 queries , Gzip On, Yac On.
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.