如何计算在Excel中的评论中的字符?

我想知道是否有一种方法来计算Excel中的评论字符? 我必须把这些意见,并把它们放到另一个应用程序,并想知道如果我能得到一个字符数,因为应用程序只接受150个字符,我知道一些意见比这更多,但我不想坐在那里并把这些评论数出来。

你不能通过公式来做,但可以用VBA做到这一点

Dim com As Comment Dim ws As Worksheet Set ws = Sheets(1) For Each com In ws.Comments MsgBox Len(com.Text) Next com 

你可以添加一个模块并创build一个函数

 Function CountCommentCharacters(r As Range) As Integer CountCommentCharacters = Len(r.Comment.Text) End Function