Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1993|回复: 5

[已解决](求助)请斑主和老师帮助,考评表计数统计问题(急)

[复制链接]
发表于 2009-12-30 09:00 | 显示全部楼层 |阅读模式
详见附件,恳请老师帮助。谢谢。 OLtAkf48.rar (2.57 KB, 下载次数: 2)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
 楼主| 发表于 2009-12-30 10:21 | 显示全部楼层
回复

使用道具 举报

发表于 2009-12-30 11:36 | 显示全部楼层    本楼为最佳答案   

工作表的代码


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Count = 1 Then
        If Target.Address = "$G$2" Then
            If MsgBox("是否重置数据?", vbYesNo) = vbYes Then
                Dim MyCell As Range
                Application.ScreenUpdating = False
                For Each MyCell In UsedRange
                    If MyCell.Interior.ColorIndex = 36 Then MyCell = ""
                Next
                Application.ScreenUpdating = True
                Exit Sub
            End If
        End If
        If Target.Address = "$F$2" Then
            If Not PreCell Is Nothing Then
                If MsgBox("恢复点击前数据吗?", vbYesNo) = vbYes Then
                    reCell = PreCell - 1
                    Exit Sub
                End If
            End If
        End If
        If Target.Interior.ColorIndex = 36 Then
            Target = Target + 1
            Set PreCell = Target
        End If
    End If
End Sub

添加一个模块,代码:

 
Public PreCell As Range

回复

使用道具 举报

 楼主| 发表于 2009-12-30 11:51 | 显示全部楼层

感谢amulee老师,能否在附件上修改一下?

回复

使用道具 举报

发表于 2009-12-30 12:10 | 显示全部楼层

我暂时上传不了附件。
回复

使用道具 举报

 楼主| 发表于 2009-12-30 12:22 | 显示全部楼层

非常感谢amulee老师。
[此贴子已经被作者于2009-12-30 12:23:06编辑过]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-6-6 19:30 , Processed in 0.207319 second(s), 7 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表