This is my first post on any forum EVER. If I am reposting a topic that has already been asked then I apologize and please re-direct me to that thread.
I found a VBA online from a user that allows me to sort a certain dynamic named range by multiple levels just like you would in a Custom Sort.
It worked great when I put the code in and clicked the green "play" button. I then closed the VBA editor. When I went back to run the macro by hitting the "Macro" button on the Developer tab, only the "create" button is available. The run/edit/delete buttons are greyed out. I have tried to delete the module in the VBA editor and it disappears from my list of macros. But when I try to recreate another macro with the same code inside, it wont let me run/edit/delete. I tried saving the file and all my other macros seem to work perfectly. The range is "Route1". I am running excel 2007. Sorry for the length post
Not sure how to post code yet. Here it is:
Sub R1srt()
Dim rng As Range
Set rng = Sheets("Sheet1").Range("Route1")
With Sheets("Sheet1").Sort
.SortFields.Clear
.SortFields.Add Key:=rng.Columns("A:A"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=rng.Columns("X:X"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=rng.Columns("M:M"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange rng
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Thanks in advance for any help!! Hopefully if I did something wrong you guys can point it out (im sure someone will)
Bookmarks