Excel精英培训网

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

[已解决]如何对批注计数

  [复制链接]
发表于 2011-3-22 09:43 | 显示全部楼层 |阅读模式
本帖最后由 ls 于 2011-3-22 09:50 编辑

如何在一定范围内对批注计数
自定义函数可以吗
最佳答案
2011-3-22 10:14
Function Nhascomm(rng As Range) As Integer
    Dim mycell As Range
    Dim k As Integer
    For Each mycell In rng
        If Not mycell.Comment Is Nothing Then
            k = k + 1
        End If
    Next
    Nhascomm = k
End Function

对批注计数.rar

4.87 KB, 下载次数: 26

发表于 2011-3-22 10:14 | 显示全部楼层    本楼为最佳答案   
Function Nhascomm(rng As Range) As Integer
    Dim mycell As Range
    Dim k As Integer
    For Each mycell In rng
        If Not mycell.Comment Is Nothing Then
            k = k + 1
        End If
    Next
    Nhascomm = k
End Function

评分

参与人数 2 +15 收起 理由
业余爱好者 + 5 学习
兰色幻想 + 10 666代码不错,回答问题积极,鼓励一下

查看全部评分

回复

使用道具 举报

发表于 2011-3-22 10:19 | 显示全部楼层
回复

使用道具 举报

发表于 2011-3-22 10:20 | 显示全部楼层

  1. Function 批注(n)
  2. 批注 =ActiveSheet.Comments.count
  3. End Function
复制代码
回复

使用道具 举报

发表于 2011-3-22 10:23 | 显示全部楼层
回复 JLxiangwei 的帖子

对批注计数.rar (9.57 KB, 下载次数: 20)

评分

参与人数 1 +10 收起 理由
业余爱好者 + 10 学习了

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2011-3-22 11:49 | 显示全部楼层
JLxiangwei 发表于 2011-3-22 10:20

做得不错,代码很简单
试了下,如果没有批注,出现错误
能否再改下
回复

使用道具 举报

 楼主| 发表于 2011-3-22 11:52 | 显示全部楼层
lyn666666 发表于 2011-3-22 10:14
Function Nhascomm(rng As Range) As Integer
    Dim mycell As Range
    Dim k As Integer

代码不错,评为最佳
回复

使用道具 举报

发表于 2011-3-22 11:54 | 显示全部楼层
回复 ls 的帖子

123.gif
回复

使用道具 举报

发表于 2011-3-22 11:59 | 显示全部楼层
看看,学习                              
回复

使用道具 举报

发表于 2011-3-22 13:17 | 显示全部楼层
虚心学习, ding
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-21 07:26 , Processed in 0.303427 second(s), 12 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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