Thread: Sorting
View Single Post
  #2   Report Post  
bigwheel
 
Posts: n/a
Default

i've done something similar and my solution was to use the following:-

Sub SortThis()
Do Until IsEmpty(ActiveCell)
strTitle = ActiveCell.Value
numSize = Len(strTitle)
If Left(strTitle, 3) = "The" Then
ActiveCell.Offset(0, 3) = Right(strTitle, (numSize - 4)) & ",The"
ElseIf Left(strTitle, 2) = "A " Then
ActiveCell.Offset(0, 3) = Right(strTitle, (numSize - 2)) & ", A"
Else
ActiveCell.Offset(0, 3) = strTitle
End If
ActiveCell.Offset(1, 0).Select

Loop
End Sub

So, with the first title selected, the macro copies the title to a new
column and tags "The" or "A" to the end of the title. Then you can sort the
resulting range as you wish (add it into the macro perhaps)

"Ronnie" wrote:

I was making a list of movies and I'm wanting to sort them by name, but how
can I get excel to ignore words like "the" and "a" and recognize the first
word after that