Quantcast
Viewing all articles
Browse latest Browse all 50162

Why does Range.Sort work typed in one way but not another?

When I have the following, the code does not work:

Code:

Set R = WS.UsedRange

R.Sort(WS.Columns(4), xlAscending, WS.Columns(11), , xlAscending)


However, the following code does work:

Code:

Set R = WS.UsedRange

R.Sort Key1:= WS.Columns(4), Order1:= xlAscending, Key2:= WS.Columns(11), Order2:= xlAscending


Why does the first way not work?

Viewing all articles
Browse latest Browse all 50162

Trending Articles