B
BB Ivan
I'm trying to code a program that allows flexible sorting based on certain
criteria. I'm having trouble using a variable for sort order. Here is the
code. When I hard code sort order (i.e., xlAscending or xlDescending) it
works fine. Any suggestions on how to make sort order accept a variable?
Selection.Sort Key1:=Range(mSortKey1), Order1:=mSortOrder1, _
Key2:=Range(mSortKey2), Order2:=mSortOrder2, _
Key3:=Range(mSortKey3), Order3:=mSortOrder3, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Thanks,
Ivan
criteria. I'm having trouble using a variable for sort order. Here is the
code. When I hard code sort order (i.e., xlAscending or xlDescending) it
works fine. Any suggestions on how to make sort order accept a variable?
Selection.Sort Key1:=Range(mSortKey1), Order1:=mSortOrder1, _
Key2:=Range(mSortKey2), Order2:=mSortOrder2, _
Key3:=Range(mSortKey3), Order3:=mSortOrder3, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Thanks,
Ivan