View Single Post
 
Old 10-27-2018, 08:31 AM
pentagram_31 pentagram_31 is offline Windows 7 32bit Office 2013
Novice
 
Join Date: Feb 2015
Posts: 13
pentagram_31 is on a distinguished road
Default A few macros or functions run in a single macro?

Hi everyone, I need to run multiple functions in a single macro. Let me tell you about it with an example:


1- Paul found it much easier to use a pencil
for taking notes as he could .......... mistakes,
which he made plenty of, very easily.
A) type B) erase C) deter
D) furnish E) release

2- You have to watch that market trader very ...........;
otherwise, he will sneakily throw a few rotten
oranges in amongst the good ones.
A) closely B) secretly C) violently
D) daringly E) placidly
3- The-Portuguese water dog is one of several.......... of dog
used by fishermen around the world to retrieve lost nets
and tackle from the water.
A) series B) descriptions C) breeds
D)races E) ranks

I have a lot of test questions/entries like this. I want to make each question (without options) a single paragraph and make them bold. Also there is an empty line between some of the questions, but not all of them, so the macro should take care of it, too. Needless to say, the macro should do its job from the beginning to the end of a document.

Currently I use a macro to make the questions bold, but this macro only make one paragraph/line of "A)", so I need to add a function to make the lines into a single paragraph.

What I'm using right now:

Code:
Sub root()
'
' root Makro
'
'
Selection.Find.ClearFormatting
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToFirst
With Selection.Find
   .Text = "A)"
   .Forward = True
   '.Wrap = wdFindContinue
   .Format = False
   .MatchCase = True
   .MatchWholeWord = True
   .MatchWildcards = False
   .MatchSoundsLike = False
   .MatchAllWordForms = False
End With
Do While Selection.Find.Execute
If Selection.Find.Found = True Then
        Selection.MoveUp Unit:=wdParagraph, Count:=3, Extend:=wdExtend
        Selection.Font.Bold = wdToggle
    Selection.MoveDown Unit:=wdParagraph, Count:=2
End If
Loop
End Sub

Last edited by pentagram_31; 10-27-2018 at 08:35 AM. Reason: I want to clarify sth.
Reply With Quote