【问题标题】:Exporting Comments from Excel从 Excel 导出注释
【发布时间】:2011-01-03 14:51:09
【问题描述】:

有没有办法从 Excel 工作表中导出 cmets 以及单元格值?

【问题讨论】:

    标签: excel export


    【解决方案1】:

    这是一个返回工作表中所有 cmets 的函数示例:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-26
      • 2016-11-04
      • 1970-01-01
      相关资源
      最近更新 更多