首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >从Excel导出注释

从Excel导出注释
EN

Stack Overflow用户
提问于 2011-01-03 22:51:09
回答 1查看 3.7K关注 0票数 4

有没有一种方法可以将注释与单元格值一起从excel表格中导出?

EN

回答 1

Stack Overflow用户

发布于 2011-01-03 23:12:49

下面是一个返回工作表中所有注释的函数示例:

代码语言:javascript
运行
复制
Sub CreateCommentsSummary()
    Dim rgComments As Range, rgCell As Range, rgOutput As Range

    ' get all cells with comment
    Set rgComments = ActiveSheet.Cells.SpecialCells(xlCellTypeComments)

    ' get cell reference where user want to place the summary
    Set rgOutput = _
        Application.InputBox(Prompt:="Select cell where you want to put the comments summary", _
        Title:="Comments Summary", Type:=8)

    ' read each cell with comment and build the summary
    For Each rgCell In rgComments
        rgOutput.Range("A1") = rgCell.Address    ' print cell address
        rgOutput.Offset(0, 1).Range("A1") = rgCell.Value   ' print cell value
        rgOutput.Offset(0, 2).Range("A1") = rgCell.comment.Text    'print cell comment text
        Set rgOutput = rgOutput.Offset(1, 0)
    Next rgCell
End Sub
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4585423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档