Help me Please with a Sorting Problem.

I have a sorting problem that is causing severe hair loss. :)

In the attached sheet, I copy information from a web page, (local radio station web site) and paste it into import.

Using a macro, the value is then pasted into the "raw" sheet. I do this to clean formatting and other misc garbage from the data. This works.

When it lands in "raw", formulas in the adjacent columns parse the data. This works.

Using a macro, it is then copied and pasted to the bottom of "Sorted". This works.

Now, what is supposed to happen, is that the data is then sorted, first by Artist (column A), then by song (column B). This USED to work.

It now will only Sort the rows by column A, regardless of whether the sort is called by macro, or done manually. I have verified that it is not a data problem, in that if I sort manually by column B, the sort works just fine. But I can not figure out why in the two column sort, it is not doing the second sort.

This problem is workbook specific. Sort seems to still work fine in other workbooks.

I have tried copying the data to another new workbook, and the same problem persists.

Your help would be very much appreciated. I suppose I could build a new sort function, but I would really rather not.

Thanks in advance.

Tin_Man

AttachmentSize
Music List.bak2_.xls178.5 KB
Vishesh's picture

Try putting this in the sort

Try putting this in the sort procedure code for sorting

With ThisWorkbook.Worksheets("Sorted")
.Columns("A:B").Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("B2") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal 'xlSortTextAsNumbers
End With

First of all, thanks for your

First of all, thanks for your assistance.

Unfortunately, it did not work.

I guess I should have mentioned I am using Office 2000 (Sorry about that), so it did not like the DataOption parameters in your code.(ERROR MSG= Compile Error: Named Argument not found)

After I removed them, Excel acted exactly as it did before the code change.

It occurred to me that maybe there was something funky about the data being selected, so I tried various versions of selecting data to be sorted... all to no avail.

Vishesh's picture

Record a macro and then

Record a macro and then modify. And, don't use select or selection.sort; rather use complete address.

I have tried that as well...

I have tried that as well... The Problem is not in the code, I do not think... Because it WAS working.

Even when I do the sort manually, via mouse clicks, I am having this problem.

Thanks for trying... I

Thanks for trying... I appreciate the effort