Thread: Sorting
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
T De Villiers[_98_] T De Villiers[_98_] is offline
external usenet poster
 
Posts: 1
Default Sorting


Hi I have a range to sort,but I need sort key to be dynamic,
so in "my version I am attempting to take range from variables
firstrow and jobcol, not quite working
thks


Standard:
Range("D117:T1328").Select
Selection.Sort Key1:=Range("T117"), Order1:=xlDescending,
Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
_
DataOption1:=xlSortNormal

My Version:
Range("D117:T1328").Select
Selection.Sort Key1:=Cells(firstrow,jobcol), Order1:=xlDescending,
Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
_
DataOption1:=xlSortNormal


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=568986