+ Reply to Thread
Results 1 to 4 of 4

Macro to copy and paste answers from the end of the document

  1. #1
    Registered User
    Join Date
    09-02-2021
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    2

    Macro to copy and paste answers from the end of the document

    Dear Friends,

    Need your help with a suggestion for a macro to copy and paste answers from the end of the document to the end of the relevant question. I have around 200 such questions in a document and it would be great if any one could suggest a macro or any solution for this. I am not good at programming hence need your help with this. Any help would be greatly appreciated. The structure of the document is as follows.

    MY DOCUMENT CONTAINS QUESTIONS AT THE TOP AND ANSWERS AT THE END AS FOLLOWS:

    Q1
    Summer is very hot.

    a. Summer
    b. Very
    c. Hot
    d. Is


    Q2
    The moon looks so beautiful.

    a. Looks
    b. Moon
    c. The
    d. Beautiful
    .
    .
    .
    .
    .

    Answers:
    1. a - Summer
    2. b - Moon
    .
    .
    .
    .

    OUTPUT FROM THE MACRO SHOULD COMBINE THE QUESTION AND THE RELEVANT ANSWERS AS FOLLOWS.

    Q1
    Summer is very hot.

    a. Summer
    b. Very
    c. Hot
    d. Is

    Answer: a
    Summer

    Q2
    The moon looks so beautiful.

    a. Looks
    b. Moon
    c. The
    d. Beautiful

    Answer: b
    Moon



    Thanks,
    Sam

  2. #2
    Forum Contributor
    Join Date
    08-12-2020
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office 16
    Posts
    241

    Re: Macro to copy and paste answers from the end of the document

    Hi Sam,

    I took a second look at your post and it looks to me that next to the "answer" someone will place a letter and the answer will populate. In the answer cell you can write the formula =if(d2="","","Moon") or =if(d2="","",A500) assuming the letter answer is in cell D2 or the answer word is in cell A500. So after any input the answer will display. Problem is you would have to build every answer and 200 is a lot. In place of A500 you may be able to write a vlookup formula but I would need to know the structure of how and where the answers are written in. Can you post the sheet?
    Last edited by Squeaky; 02-21-2022 at 12:25 PM.

  3. #3
    Registered User
    Join Date
    09-02-2021
    Location
    Chennai
    MS-Off Ver
    2013
    Posts
    2

    Re: Macro to copy and paste answers from the end of the document

    Hi Friend,

    Thank you for the response. I am sorry I forgot to mention that it is an MS Word document and not an Excel sheet.
    I am looking for an MS Word macro to solve the above. The format of the document is exactly as above, just with many questions. Hope this clarifies. thanks.

    Sam

  4. #4
    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: Macro to copy and paste answers from the end of the document

    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ 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. Macro to copy/paste picture of table in Excel worksheet into a Word document
    By grbears in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2017, 11:25 AM
  2. [SOLVED] Macro-Generated Stacked Chart with Double X-Axis Breaks on Copy/Paste or Document Reopen
    By Jefffey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-07-2017, 04:20 PM
  3. Replies: 0
    Last Post: 06-10-2016, 06:52 AM
  4. [SOLVED] Document copy and paste macro errors
    By glide2131 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2015, 03:57 PM
  5. Macro to copy and paste from another Word 2007 document.
    By Excelnoub in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 04-08-2014, 09:06 PM
  6. Macro that copy all data inside a workbook and paste in value in another document
    By elpoil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 10:07 AM
  7. Replies: 1
    Last Post: 10-17-2005, 04:05 AM

Tags for this Thread

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