![]() |
#1
|
|||
|
|||
![]()
Hello friends,
It's another year of exams for my students and I am stuck trying to upload an exam to our antiquated system. The exam system takes a particular format, I figured out how to upload the questions, but not the answers. The questions are in tables. 1. This animal says meow. a. cat b. dog c. mouse d. bird ANS: A 2. This animal says woof. a. cat b. dog c. mouse d. bird ANS: B 3. Birds have wings. ANS: T Ideally, I would like it to look like: This animal says meow. a. cat This animal says woof. b. dog Birds have wings. T I had a similar macro that I was taught last year on this forum: Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Format = False .Forward = True .Wrap = wdFindContinue .MatchWildcards = True .Text = "([0-9]@\)*^13)(*)(Answer:*^13)" .Replacement.Text = "\1\3\2" .Execute Replace:=wdReplaceAll .Text = "^13^13" .Replacement.Text = "^px^&" .Execute Replace:=wdReplaceAll .Text = "[0-9]@\) (*Answer:*)([A-Z])*(\2\)*^13)*^13{2}" .Replacement.Text = "\1\3^p" .Execute Replace:=wdReplaceAll End With End With Application.ScreenUpdating = True End Sub I have attached a sample: sampletext.docx |
Tags |
macro, tables, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Surge | Word | 3 | 09-19-2015 04:01 AM |
How can I delete spaces & lines in a table cell | mrayncrental | Word VBA | 3 | 10-20-2014 07:09 PM |
![]() |
Snvlsfoal | Word Tables | 1 | 08-11-2011 05:45 AM |
![]() |
czomberzdaniela | Word Tables | 8 | 04-12-2011 05:48 AM |
Adding table lines to protected form | razberri | Word Tables | 2 | 10-27-2010 05:58 PM |