Reversing a list

S

SootJuggler

I have created a un-numbered, non-alpha sorted, un-levelled line-by-line
sequence of say:

1. Coastal settlements
or
2. Film titles.

And find that I have created them the wrong way about and wish to invert
the list. Is there a 'cool' way of doing this in Word (or anything else
for that matter) or do I have to (painfully) promote/demote lines
individually?

For practice try this and put it in the reverse order:

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)
 
G

Graham Mayor

Assuming each line is a separate paragraph, select the list then Table >
Sort (Word 2007 click the sort button on the Home tab). Choose your
preferred sort order. Your list in reversed order would give

Up in the World (1956)

Trouble in Store (1953)

The Switch (1963)

The Perfect Woman (1949)

The Malta Story (1953)

The Early Bird (1965)

The Cardboard Cavalier (1949)

The Beauty Jungle (1964)

The Angel Who Pawned Her Harp (1954)

Stolen Hours (1963)

Ramsbottom Rides Again (1956)

Man of the Moment (1955)

London Town (1946)

Just My Luck (1957)

Gonks Go Beat (1965)

Follow a Star (1959)

Carry on Regardless (1961)

Alf's Baby (1953)

A Stitch in Time (1963)

A King in New York (1957)

A Kind of Loving (1962)


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

If you want them sorting on the date then choose the number sort option,
rather than the text sort option thus

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)


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

CyberTaz

By Golly I did go about it the hard way, didn't I? But doesn't it require
specifying "Number", or is the default in 2007 not "Text"? I admit I haven't
done much sorting it 2007 & can't visualize how it's implemented.

Regards |:>)
Bob Jones
[MVP] Office:Mac
 
G

Graham Mayor

The default is indeed Text, but you could equally choose Number or Date. For
this type of sort you need Number.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

SootJuggler

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'?)
 
G

Graham Mayor

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

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
C

CyberTaz

.... Or use the "convert to table" method as I suggested earlier ‹ I'm just
not a big VBA guy :)

Regards |:>)
Bob Jones
[MVP] Office:Mac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top