提示:其它语言是由 Google 机器翻译的。 你可以访问 English 版本。
登录
x
or
x
x
马上登记
x

or

如何将注释从Excel导出到Word?

对于Excel用户,将注释插入单元格是一项常见任务,有时,您需要将这些注释复制并粘贴到Word文档中才能达到某种目的。 当然,您可以逐个将评论复制并粘贴到Word中,但这是一项冗长而费时的工作。 有没有办法一次将所有的评论从Excel导出到Word?

使用VBA代码将当前工作表中的注释导出到Word

Office选项卡在Office中启用选项卡式编辑和浏览,使您的工作更轻松......
Kutools for Excel - 最佳办公生产力工具将解决您的大部分Excel问题
  • 重用任何东西: 将最常用或最复杂的公式,图表和其他任何内容添加到您的收藏夹中,并在将来快速重复使用它们。
  • 超过20文本功能: 从文本字符串中提取数字; 提取或删除部分文本; 将数字和货币转换为英语单词...
  • 合并工具:多个工作簿和表格合二为一; 合并多个单元格/行/列而不丢失数据; 合并重复行和总和...
  • 拆分工具:根据价值将数据拆分为多个表格; 一个工作簿到多个Excel,PDF或CSV文件; 一列到多列......
  • 粘贴跳过 隐藏/过滤行; 数和总和 按背景颜色; 创建邮件列表和 通过Cell的价值发送电子邮件...
  • 超级过滤器: 创建高级过滤方案并应用于任何工作表; 排序 按周,日,频率等; 筛选 通过大胆,公式,评论......
  • 超过300强大的功能; 适用于Office 2007-2019和365; 支持所有语言; 在公司轻松部署; 全功能60天免费试用。

箭头蓝色右泡使用VBA代码将当前工作表中的注释导出到Word


不幸的是,Excel不提供将所有评论一次性复制并粘贴到Word的功能。 但是,使用以下VBA代码,可以将活动工作表的所有注释快速导出到Word文档。

1。 按住 ALT + F11 键打开 Microsoft Visual Basic for Applications窗口.

2。 点击 插页 > 模块,并将以下代码粘贴到 模块窗口.

VBA代码:将当前工作表中的评论导出到Word

Sub CopyCommentsToWord()
'Update 20140325
Dim xComment As Comment
Dim wApp As Object
On Error Resume Next
Set wApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
  Err.Clear
  Set wApp = CreateObject("Word.Application")
End If
wApp.Visible = True
wApp.Documents.Add DocumentType:=0
For Each xComment In Application.ActiveSheet.Comments
    wApp.Selection.TypeText xComment.Parent.Address & vbTab & xComment.Text
    wApp.Selection.TypeParagraph
Next
Set wApp = Nothing
End Sub

3。 然后按 F5 键以运行此代码,并且活动工作表中的所有注释都已导出到具有其单元地址的新Word文档。 看截图:

DOC-出口comments1


相关文章:

如何在Excel中快速插入注释到多个单元格?

如何在Excel中更改评论框的形状?

如何更改Excel中单元格中的所有评论格式?

如何在Excel中更改所有评论的作者姓名?


Kutools for Excel - 最佳办公生产力工具提高80%的生产力

  • 重用: 快速插入 复杂的公式,图表 以及你以前用过的任何东西; 加密单元格 密码; 创建邮件列表 并发送电子邮件...
  • 超级方程式酒吧 (轻松编辑多行文字和公式); 阅读布局 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不丢失数据; 分裂细胞含量; 组合重复的行/列...防止重复的细胞; 比较范围...
  • 选择复制或唯一 行; 选择空行 (所有细胞都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择......
  • 精确复制 多个单元格而不更改公式参考; 自动创建参考 多张表; 插入项目符号,复选框等等......
  • 提取文本,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级过滤器 (将过滤方案保存并应用到其他工作表); 高级排序 按月/周/日,频率等; 特殊过滤器 用粗体,斜体......
  • 结合工作簿和工作表; 根据键列合并表; 将数据拆分为多个表格; 批量转换xls,xlsx和PDF...
  • 超过300强大的功能。 支持Office / Excel 2007-2019和365。 支持所有语言。 在您的企业或组织中轻松部署。 全功能60天免费试用。
kte tab 201905

Office选项卡为Office提供选项卡式界面,使您的工作更轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,Publisher,Access,Visio和Project。
  • 在同一窗口的新选项卡中打开并创建多个文档,而不是在新窗口中。
  • 通过50%提高您的工作效率,每天为您减少数百次鼠标点击!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Sierra · 4 months ago
    I copied and pasted exactly but it only generated a blank word document. Any ideas?


    Sub CopyCommentsToWord()
    'Update 20140325
    Dim xComment As Comment
    Dim wApp As Object
    On Error Resume Next
    Set wApp = GetObject(, "Word.Application")
    If Err.Number <> 0 Then
    Err.Clear
    Set wApp = CreateObject("Word.Application")
    End If
    wApp.Visible = True
    wApp.Documents.Add DocumentType:=0
    For Each xComment In Application.ActiveSheet.Comments
    wApp.Selection.TypeText xComment.Parent.Address & vbTab & xComment.Text
    wApp.Selection.TypeParagraph
    Next
    Set wApp = Nothing
    End Sub
    • To post as a guest, your comment is unpublished.
      Dario · 1 months ago
      same issue. did you manage to solve?
  • To post as a guest, your comment is unpublished.
    Sam · 6 months ago
    This is super helpful! Thanks!
    Is there a way to pull in the row or column header rather than the cell position (B4)?
    • To post as a guest, your comment is unpublished.
      Evaristo · 3 months ago
      I was able to get this result by changing the "xComment.Parent.Address" to "xComment.Parent.Value" in row 14.
  • To post as a guest, your comment is unpublished.
    Jay Ray · 10 months ago
    omg! it was really helpful!
  • To post as a guest, your comment is unpublished.
    Darrell · 2 years ago
    This is great and helps! Is there a way to get actual text within the cell to replace the cell number or to be included? I have headers and balloon instructions in the headers. I am trying to create a word procedure on filling out the rows with headers of the data (Ex.; "Name") and then the comment box tells the user the format.

    Currently Shows with above macro:

    A1 Username:


    - Enter Name of Borrower as seen on Borrower organizational documents or other name supporting documents.


    Looking for it so show the text of cell A1 which is Company Name.


    Any help greatly appreciated!
  • To post as a guest, your comment is unpublished.
    Bartolomeu · 2 years ago
    Can it be done to extract from filtred rows after applying filter ?
    Thank you.
  • To post as a guest, your comment is unpublished.
    peod · 2 years ago
    it really helped. tq!
  • To post as a guest, your comment is unpublished.
    david · 2 years ago
    does anyone know if I can do this but only copying comments from a specific row?

    any help will be much appreciated ive been trying to work on this for ages.
  • To post as a guest, your comment is unpublished.
    randi · 2 years ago
    get the message "Compile error: Invalid outside procedure". Now what?
    • To post as a guest, your comment is unpublished.
      Kate · 2 years ago
      I had the same message - did you manage to resolve this Randi?
  • To post as a guest, your comment is unpublished.
    Gillian · 3 years ago
    This worked perfectly and was exactly what I needed! Thank you so much.
  • To post as a guest, your comment is unpublished.
    vladmir · 4 years ago
    hi,

    Excellent article, I was curious to know, if I have images in those comments, will that VBA code above also quickly export all images in the comments that images of an active worksheet to the Word document?

    Thank you for taking the time to read this, much appreciated.

    Regards,

    Vladmir