I have this code that works perfectly:
ActiveWorkbook.Worksheets("compleanni").Sort.SortFields.Add2 Key:=Range( _
"I6:I23"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
I'd like to change it like this:
myorder="xlAscending"
....
....
Order:=myorder
but it doesn't work: I get run-time error 13. Any suggestions?
myorder = xlAscending