Sorry I forgot to say, (can't you read minds? <g> ) put the letter, in the
same that you want to start the sort on in cell F1.
I see as well that there is an unfortunate line break in the Newsgroup
posting and I found that if the case of the letter in F1 is different to the
case of the initial letter of the list then it errored out. This new code
should take care of both of these things. Delete the code and paste this
one in, it will ensure that there are no breaks where there shouldn't be:
Sub ReSort()
Dim eNdRo As Long
Dim cUtRo As Long
Dim x As Long
eNdRo = Cells(Rows.Count, 1).End(xlUp).Row
With Range(Cells(1, 1), Cells(eNdRo, 5))
.Sort Key1:=Range("A1"), Order1:= _
xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End With
For x = 1 To eNdRo
If UCase(Left(Cells(x, 1).Value, 1)) = _
UCase(Cells(1, 6).Value) Then
cUtRo = x
Exit For
End If
Next x
Range(Cells(1, 1), Cells(cUtRo - 1, 5)).Cut _
Destination:=Cells(eNdRo + 1, 1)
eNdRo = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(cUtRo, 1), Cells(eNdRo, 5)).Cut _
Destination:=Cells(1, 1)
End Sub
Post back when you get it working.
(or if you don't of course!)
--
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk