sort a list of references in MSWord ignoring asterisk

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have list of two hundred references for a paper and some of the references
have an asterisk and some do not. I need to sort them alphabetically and I
would like MSWord to do it, ignoring the asterisk. So far everytime I sort
all of the items with asterisks are group together and they need to be mixed
in with all the other references, alphabetically, without regards to the
asterisk. Is there a special rule or trick I can do to accomplish this?
 
Here's one approach, not necessarily the most efficient:

Do a Find and Replace that finds all the asterisks and replaces them with
asterisks formatted as hidden text. Sort the references, with hidden text
not showing.

Show hidden text. Go back to Find and Replace, find asterisks formatted as
hidden text, and format them as not-hidden asterisks.

To Find and Replace with formatting, click the More button, and with the
cursor in the appropriate box, use the Format | Font menu in the F&R dialog
to format the box as desired.

But for all I know about sorting, Word is hiding an easy setting to do what
you want. :)
 
Joy,

I scratch this clunky macro together which may work (no better than
Daiya's suggestion).

Select the text and run:

Sub SortSpecial()
Dim oTbl As Word.Table
Dim oCell As Cell
Selection.ConvertToTable Separator:=wdSeparateByParagraphs,
NumColumns:=1
Set oTbl = ActiveDocument.Tables(1)
Selection.Cells.Split NumRows:=1, NumColumns:=2,
MergeBeforeSplit:=False
For Each oCell In oTbl.Columns(1).Cells
If oCell.Range.Characters.First = Chr(42) Then
oCell.Range.Characters.First.Delete
oTbl.Cell(oCell.RowIndex, 2).Range.Text = Chr(42)
End If
Next oCell
oTbl.Sort ExcludeHeader:=False, FieldNumber:="Column 1", _
SortFieldType:=wdSortFieldAlphanumeric, _
SortOrder:=wdSortOrderAscending
For Each oCell In oTbl.Columns(2).Cells
If oCell.Range.Characters.First = "*" Then
oCell.Range.Delete
oTbl.Cell(oCell.RowIndex, 1).Range.InsertBefore Chr(42)
End If
Next oCell
oTbl.Select
Selection.Cells.Merge
oTbl.ConvertToText
End Sub
 
Another approach is to add asterisks to ALL the references and format the
ones you don't want printed as either Hidden or Font Color: White. The
latter has the added advantage that all the entries will be aligned;
sometimes this is desirable and other times unnecessary or unwanted.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
PS to all responses‹

I would make a COPY of your file, and then try your chosen solution. Just
in case. Never a bad idea to take precautions.
 
Back
Top