gpt4 book ai didi

excel - 从 Excel 导出注释

转载 作者:行者123 更新时间:2023-12-02 10:57:53 31 4
gpt4 key购买 nike

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

最佳答案

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

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

关于excel - 从 Excel 导出注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4585423/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com