Sorting

  • Thread starter Thread starter Tomk
  • Start date Start date
Nothing built into excel allows this.

You could use a formula in another column to ignore the first word (like The,
An, A, ...) and then sort by that helper column.
 
With VBA:

Sub Sort()
Set Start = Range("a1")
Start.Offset(0, 1).EntireColumn.Insert Shift:=xlToRight
For Each c In Range(Start, Start.End(xlDown))
If UCase(Left(c, 3)) = "THE" Then
c.Offset(0, 1) = Mid(c, 5)
Else
c.Offset(0, 1) = c
End If
Next c
Start.CurrentRegion.Sort Key1:=Start.Offset(0, 1),
Order1:=xlAscending, Header:=xlGuess
Start.Offset(0, 1).EntireColumn.Delete
End Sub

http://cjoint.com/?cdrExzkMSs

JB
http://boisgontierjacques.free.fr/
 

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

Back
Top