PDA

View Full Version : Arrange answers below the question from a different location in the document



punk12345
11-03-2013, 10:52 AM
Hello friends, this is my first post to this forum.

I am looking for a VBA macro to accomplish the following. I have a word document in the following format.

1. Question (Multiline)
A. Option 1
B. Option 2
C. Option 3
D. Option 4

2. Question (Multiline)
A. Option 1
B. Option 2
C. Option 3
D. Option 4

.. (goes on till 200 questions)

Answers

1. A. Answer (Multiline, some answers have tables/graphics)

2. C. Answer (Multiline)

.. (goes on till 200 answers)

Basically the macro should cut and paste the answers below the appropriate questions, so the output looks something like this:

1. Question (Multiline)
A. Option 1
B. Option 2
C. Option 3
D. Option 4

1. A. Answer (Multiline)

2. Question (Multiline)
A. Option 1
B. Option 2
C. Option 3
D. Option 4

2. C. Answer (Multiline)

.......
Just FYI: Some options are multiline too.

Any help in this regards is greatly appreciated. Thanks in advance.

punk12345
11-07-2013, 01:32 AM
Dear friends, request your expert guidance in this regards.

Thanks,

macropod
11-07-2013, 01:38 AM
To do this would require considerable programming effort. It would take far less time to do this manually than it would to write, test & debug a macro. For future reference, I'd suggest using endnotes for the Question numbers and insert the answers into the endnotes. Also insert Section breaks between the Questions. Tell Word to insert endnotes at the end of each Section. Then, by using the option to 'suppress endnotes' in Word's page layout functions, you can toggle your answer locations between their questions and the end of the document.

punk12345
11-07-2013, 01:48 AM
Thank you so much for getting back on this Paul. I really appreciate it. As suggested, I guess I would need to do it manually.

fumei
11-07-2013, 04:09 PM
I have to agree with Paul, it may be possible but it would take a huge effort. It would perhaps be easier if there was design from the start. That is, the document is created with this end result in mind.

punk12345
11-07-2013, 08:51 PM
Thank you

fumei
11-07-2013, 09:28 PM
As thought, if the questions were all answered froma userform (rather than text in the document) getting the questions and answers together would be a snap. The main reason there would be so much effort is that you are trying to retrofit a solution to a structure that is already fixed in space.

macropod
11-07-2013, 09:38 PM
FWIW, this is in many respects a variation on the work done here: http://www.vbaexpress.com/forum/showthread.php?44084-Solved-Can-you-convert-hard-entered-endnotes-to-footnotes. Not something I'd care to re-work for a one-off exercise.

punk12345
11-07-2013, 09:52 PM
I agree with you on this. But I have several other documents in this same format which I am trying to convert. Anyways, I have already started doing it manually, should be through soon. Thanks again for the help.

punk12345
11-07-2013, 09:53 PM
Thank you Paul. I will go through the thread as well.