Created
October 3, 2014 15:55
-
-
Save ojas/e7dfdd3865bcb17b8f35 to your computer and use it in GitHub Desktop.
Office Macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' via http://www.extendoffice.com/documents/excel/1579-excel-export-comments-to-word.html | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment