Re: Reversing a list - Back again!
- From: "Graham Mayor" <gmayor@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 15 Jun 2009 16:23:59 +0300
OK - Plan B. Again assuming each line is a paragraph, the following macro
will reverse the list on a place by place basis. Select the list and run the
macro.
Sub ReverseList()
Dim oList As Variant
Dim sList As String
Set oList = Selection.Range
oList = Split(oList, Chr(13))
sList = ""
For i = UBound(oList) - 1 To 0 Step -1
If i = UBound(oList) - 1 Then
sList = oList(i)
Else
sList = sList & vbCr & oList(i)
End If
Next i
Selection.TypeText sList
End Sub
http://www.gmayor.com/installing_macro.htm
Your original list would now be
London Town (1946)
The Cardboard Cavalier (1949)
The Perfect Woman (1949)
Alf's Baby (1953)
Trouble in Store (1953)
The Malta Story (1953)
The Angel Who Pawned Her Harp (1954)
Man of the Moment (1955)
Ramsbottom Rides Again (1956)
Up in the World (1956)
A King in New York (1957)
Just My Luck (1957)
Follow a Star (1959)
Carry on Regardless (1961)
A Kind of Loving (1962)
A Stitch in Time (1963)
The Switch (1963)
Stolen Hours (1963)
The Beauty Jungle (1964)
Gonks Go Beat (1965)
The Early Bird (1965)
and your town list
Easington
Withernsea
Tunstall
Grimston
East Newton
Cowden
Mappleton
Hornsea
Atwick
Skipsea
Barmston
Wilsthorpe
Bridlington
Sewerby
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
SootJuggler wrote:
Hi - Back again
Unfortunately when I do a 'Paragraphs', 'Number', 'Descending' sort on
the list:
The Early Bird (1965)
Gonks Go Beat (1965)
The Beauty Jungle (1964)
Stolen Hours (1963)
The Switch (1963)
A Stitch in Time (1963)
A Kind of Loving (1962)
Carry on Regardless (1961)
Follow a Star (1959)
Just My Luck (1957)
A King in New York (1957)
Up in the World (1956)
Ramsbottom Rides Again (1956)
Man of the Moment (1955)
The Angel Who Pawned Her Harp (1954)
The Malta Story (1953)
Trouble in Store (1953)
Alf's Baby (1953)
The Perfect Woman (1949)
The Cardboard Cavalier (1949)
London Town (1946)
I get:
London Town (1946)
The Perfect Woman (1949)
The Cardboard Cavalier (1949)
The Malta Story (1953)
Trouble in Store (1953)
Alf's Baby (1953)
The Angel Who Pawned Her Harp (1954)
Man of the Moment (1955)
Up in the World (1956)
Ramsbottom Rides Again (1956)
Just My Luck (1957)
A King in New York (1957)
Follow a Star (1959)
Carry on Regardless (1961)
A Kind of Loving (1962)
Stolen Hours (1963)
The Switch (1963)
A Stitch in Time (1963)
The Beauty Jungle (1964)
The Early Bird (1965)
Gonks Go Beat (1965)
Which is ***NOT*** an exact reversal as same-year films do not
exchange relative places. The original list was already ordered,
what I want is the list reversing. You might say that that is not
terribly important in the case of a list of films. It might be
clearer if I give you as an example a sequence of a succession of
coastal settlements that do not have numbers in them as this shows
the importance of an exact reversal.
Sewerby
Bridlington
Wilsthorpe
Barmston
Skipsea
Atwick
Hornsea
Mappleton
Cowden
East Newton
Grimston
Tunstall
Withernsea
Easington
Can you invert this list. (Did somebody just say 'macro'?)
.
- References:
- Reversing a list
- From: SootJuggler
- Re: Reversing a list
- From: Graham Mayor
- Re: Reversing a list
- From: CyberTaz
- Re: Reversing a list
- From: Graham Mayor
- Re: Reversing a list - Back again!
- From: SootJuggler
- Reversing a list
- Prev by Date: Re: I am unable to download a word document to a job web site
- Next by Date: Re: TOC font won't cooperate
- Previous by thread: Re: Reversing a list - Back again!
- Next by thread: Re: Reversing a list - Back again!
- Index(es):
Relevant Pages
|