Q:如何编写提取单元格批注的自定义函数? A:提取单元格批注的自定义函数代码如下: 如何编写提取单元格批注内容的自定义函数? http://www.exceltip.net/thread-4601-1-1-232.html Function GetComment(sRng As Range, sDisp As Integer) As String On Error GoTo ErrLine Dim sComment As String Application.Volatile True If sRng.Count = 1 Then sComment = sRng.Comment.Text If sDisp = 1 Then GetComment = Right(sComment, Len(sComment) - InStr(1, sComment, ":")) ElseIf sDisp = 2 Then GetComment = Left(sComment, InStr(1, sComment, ":") - 1) Else GetComment = sComment End If End If ErrLine: End Function |