+ Reply to Thread
Results 1 to 10 of 10

Export comments from current worksheet to Word - got the script but need it to go column

  1. #1
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Export comments from current worksheet to Word - got the script but need it to go column

    Hi everyone

    Thanks to everyone that is helping me.

    Found this VBA code that does almost exactly what I was looking for.

    Export comments from current worksheet to Word.
    It goes from row to row.
    I need it to go from column to column.

    VBA Code source:
    https://www.extendoffice.com/documen...s-to-word.html

    Please Login or Register  to view this content.
    Can it be done?

    Thank you
    Last edited by boninm; 10-19-2017 at 05:30 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    Done.

    Thanks for advising me what to do.

  4. #4
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    just so I know, can folks now start helping me with this, or do I need to repost it again?
    Thanks Ali

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    Which part is going from row to row?

    Is it reading the comments from Excel or writing then to Word?
    If posting code please use code tags, see here.

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    To set the comment output order to columns by row you could use something along the lines of:
    Please Login or Register  to view this content.
    I'll leave it to you to add the Word automation code. Once you've automated the document, simply output StrCmt to it.

    To change the output order to rows by column, simply swap:
    For r = 1 To lRow
    and:
    For c = 1 To lCol
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    Hi Norie

    The script does the reading from column to column.
    It's from Excel, going to Word.

    What I would like is for the script to row to row (A1 to C1, then A2 to C2, up to K1 to K3) instead of column (A1 to A10, then B1 to B10, C1 to C10)

    Hope this explains it a bit better.

    Thank you

  8. #8
    Registered User
    Join Date
    05-28-2017
    Location
    Aarhus, Denmark
    MS-Off Ver
    MS Office 2016
    Posts
    3

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    This code works with row to row, but I haven't tried it with coloumn to coloumn, but I suppose it should work.
    The VBA code works by creating a table with the words you want to paste into word. By making a table you can always move it later, and you can sort the words within the table without making a mess.

    Please Login or Register  to view this content.
    I'm a bit confused if you want to go from column to column or row to row. This was for column to column. If you want the script for row to row it is:

    Please Login or Register  to view this content.
    Last edited by Rothuizen; 10-20-2017 at 03:11 AM.

  9. #9
    Registered User
    Join Date
    10-15-2017
    Location
    kanata, ontario, canada
    MS-Off Ver
    MS 365
    Posts
    37

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    Thank you - will check it out

  10. #10
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Export comments from current worksheet to Word - got the script but need it to go colu

    Quote Originally Posted by boninm View Post
    What I would like is for the script to row to row (A1 to C1, then A2 to C2, up to K1 to K3) instead of column (A1 to A10, then B1 to B10, C1 to C10)
    That's what the code I posted does. As I said, all you need do is add the Word automation code (which you already have) and output StrCmt to the document instead of to a message box.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I export an Excel worksheet to Word with some specific formatting?
    By jasonfromchico in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2015, 04:26 PM
  2. How to export images in comments from Excel to Word or Powerpoint using VBA Question?
    By Vladmir1111 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2015, 07:01 PM
  3. Export review comments and feedback from word document to excel
    By ujosan in forum Hello..Introduce yourself
    Replies: 3
    Last Post: 02-17-2014, 02:19 AM
  4. Export comments/feedback from word document to excel
    By ujosan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2014, 11:59 AM
  5. [SOLVED] Export Rows based on value in column. Delete Row in current doc.
    By basketcase in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-18-2012, 12:49 PM
  6. [SOLVED] Export comments to new column
    By Aleks in forum Excel General
    Replies: 1
    Last Post: 11-03-2005, 01:10 PM
  7. How do I export comments into another excel column as cell content
    By Hernan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-25-2005, 11:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1