View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
thiaga thiaga is offline
external usenet poster
 
Posts: 19
Default Selecting a dynamic Range and sorting

I have a dynamic Range Starting from Cell B9 and the last column is R
It is not necessary that the last cell in the last column to have a
value.
But the Last row in Column B will have a value.

This is the code i used to select the range and sort

With Sheets("Unassigned Requests")
Range(Range("B9"), Range("B9").End(xlDown)(0)).EntireRow.Select
Selection.Sort Key1:=Range("B9"), Order1:=xlAscending,
Key2:=Range("C9") _
, Order2:=xlAscending, Key3:=Range("E9"), Order3:=xlAscending,
_
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, DataOption2:=xlSortNormal,
DataOption3:= _
xlSortNormal
End With

The above code, does not select the last row in the range.
Also at the end, it has the rows selected, can i show it de-selected?

Thanks in Anticipation
Thiaga