Gå til hovedindhold

Hvordan eksporteres kommentarer fra Excel til Word?

For Excel-brugere er det en almindelig opgave at indsætte kommentarer i cellerne. Nogle gange skal du kopiere og indsætte disse kommentarer i et Word-dokument til et eller andet formål. Selvfølgelig kan du kopiere og indsætte kommentaren i Word en efter en, men dette er et kedeligt og tidskrævende job. Er der nogen måde at eksportere alle kommentarerne fra Excel til Word på én gang?

Eksporter kommentarer fra det aktuelle regneark til Word med VBA-kode


pil blå højre bobleEksporter kommentarer fra det aktuelle regneark til Word med VBA-kode

Desværre leverer Excel ikke funktionen til at kopiere og indsætte alle kommentarer til Word på én gang. Med den følgende VBA-kode kan du dog hurtigt eksportere alle kommentarer i det aktive regneark til Word-dokumentet.

1. Hold nede ALT + F11 nøgler til at åbne Vinduet Microsoft Visual Basic til applikationer.

2. Klik indsatte > Moduler, og indsæt følgende kode i Modul vindue.

VBA-kode: Eksporter kommentarer fra det aktuelle regneark til 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. Tryk derefter på F5 nøgle til at køre denne kode, og alle kommentarerne i det aktive regneark er eksporteret til et nyt Word-dokument med dets celleadresse. Se skærmbillede:

doc-eksport-kommentarer1


Relaterede artikler:

Hvordan indsættes hurtigt en kommentar til flere celler i Excel?

Hvordan ændres formen på kommentarfeltet i Excel?

Hvordan ændres alle kommentarformater i celler i Excel?

Hvordan ændres alle kommentarers forfatternavn i Excel?

Bedste kontorproduktivitetsværktøjer

🤖 Kutools AI Aide: Revolutionér dataanalyse baseret på: Intelligent udførelse   |  Generer kode  |  Opret brugerdefinerede formler  |  Analyser data og generer diagrammer  |  Aktiver Kutools funktioner...
Populære funktioner: Find, fremhæv eller identificer dubletter   |  Slet tomme rækker   |  Kombiner kolonner eller celler uden at miste data   |   Runde uden formel ...
Super opslag: VLookup med flere kriterier    Multiple Value VLookup  |   VOpslag på tværs af flere ark   |   Fuzzy Lookup ....
Avanceret rulleliste: Opret hurtigt rulleliste   |  Afhængig rulleliste   |  Multivælg rulleliste ....
Column Manager: Tilføj et bestemt antal kolonner  |  Flyt kolonner  |  Skift synlighedsstatus for skjulte kolonner  |  Sammenlign områder og kolonner ...
Fremhævede funktioner: Grid fokus   |  Designvisning   |   Stor Formel Bar    Arbejdsbog & Ark Manager   |  Ressourcebibliotek (Autotekst)   |  Datovælger   |  Kombiner regneark   |  Krypter/Dekrypter celler    Send e-mails efter liste   |  Superfilter   |   Specielt filter (filter fed/kursiv/gennemstreget...) ...
Top 15 værktøjssæt12 tekst Værktøjer (tilføje tekst, Fjern tegn, ...)   |   50 + Chart Typer (Gantt kort, ...)   |   40+ Praktisk formler (Beregn alder baseret på fødselsdag, ...)   |   19 Indsættelse Værktøjer (Indsæt QR-kode, Indsæt billede fra sti, ...)   |   12 Konvertering Værktøjer (Tal til ord, Valutaomregning, ...)   |   7 Flet og del Værktøjer (Avancerede kombinere rækker, Opdel celler, ...)   |   ... og mere

Overlad dine Excel-færdigheder med Kutools til Excel, og oplev effektivitet som aldrig før. Kutools til Excel tilbyder over 300 avancerede funktioner for at øge produktiviteten og spare tid.  Klik her for at få den funktion, du har mest brug for...

Beskrivelse


Fanen Office bringer en grænseflade til et kontor med Office, og gør dit arbejde meget lettere

  • Aktiver redigering og læsning af faner i Word, Excel, PowerPoint, Publisher, Access, Visio og Project.
  • Åbn og opret flere dokumenter i nye faner i det samme vindue snarere end i nye vinduer.
  • Øger din produktivitet med 50 % og reducerer hundredvis af museklik for dig hver dag!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is excellent! however i am struggling to pin the comments to where it belong in the  worksheet. is there any way to be able to label the rows or column or cell in which the comments is extracted?
This comment was minimized by the moderator on the site
Able To Extract starts with the initial measurable data set and generates derived values ​.Users can insert and customize their numbers to professionally index business.
Philip
patchhere.com
This comment was minimized by the moderator on the site
Hey I figured out how to fix this. Line 13 needs to read "For Each xComment In Application.ActiveSheet.CommentsThreaded". (The output isn't exactly like the screenshot, you would have to add xComment.Author or perhaps some other properties in the For loop - but changing from Comments to CommentsThreaded gets this working again.)
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
same issue. did you manage to solve?
This comment was minimized by the moderator on the site
Same...any thoughts?
This comment was minimized by the moderator on the site
This is super helpful! Thanks!
Is there a way to pull in the row or column header rather than the cell position (B4)?
This comment was minimized by the moderator on the site
I was able to get this result by changing the "xComment.Parent.Address" to "xComment.Parent.Value" in row 14.
This comment was minimized by the moderator on the site
omg! it was really helpful!
This comment was minimized by the moderator on the site
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!
This comment was minimized by the moderator on the site
Can it be done to extract from filtred rows after applying filter ? Thank you.
This comment was minimized by the moderator on the site
it really helped. tq!
This comment was minimized by the moderator on the site
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.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations