View Single Post
  #6   Report Post  
Greg Maxey
 
Posts: n/a
Default

Luc,

Thanks for the feedback.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Luc wrote:
Greg,
Just taking some time to thank you for your valuable contibutions in
the newsgroup. This is a typical example of a time and money saver.
This is also why we keep coming back to this newsgroup to find
answers you will not find easily somewhere else.
Thanks again Greg!
Luc
"Greg Maxey" schreef in bericht
...
A little more general and corrects the addition of a blank paragraph
if myRng.end is the same as activedocument.end

Sub ReverseParagraphOrder()
'Created 04/20/2005 by Greg Maxey
'Reverses the order of a group of selected paragraphs
Dim myRng As Range
Dim tmpString
Dim i As Integer

Set myRng = Selection.Range
For i = myRng.Paragraphs.Count To 1 Step -1
tmpString = tmpString & myRng.Paragraphs(i).Range
Next i
If myRng.End = ActiveDocument.Range.End Then
myRng.Text = Left(tmpString, Len(tmpString) - 1)
Else
myRng.Text = tmpString
End If
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

sdlfkj wrote:
I have lines of numbers that I need to reverse.

So instead of
3rd line
2nd line
1st line

I need it to read
1st line
2nd line
3rd line

I just want to highlight the 3 lines and click something to reverse
the order instead of cutting and pasting hundreds of times. Any
suggestions?