View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Sort selected range

Set rng = Range("D65534").End(xlUp)
Set rng = Range(rng, rng.End(xlToRight))
rng.Sort Key1:=rng.Cells(1, 1), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal


--
__________________________________
HTH

Bob

"J.W. Aldridge" wrote in message
...
How do I input the code to sort the selected range from here?

The range may be any row, so leave that portion open/variable.


Range("D65534").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlToRight)).Select