Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to sort a selection of rows?
This code selects some rows in my sheet:
With Rng.Parent .Select .Range("B4", LastCell).Select End With The number of columns and rows are variable. I want to sort the rows. How can I do it? I am working in Excel 2007. Any help is welcome!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to sort a selection of rows?
Use something like
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Key2:=Range("B2") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal "jgmiddel" wrote: This code selects some rows in my sheet: With Rng.Parent .Select .Range("B4", LastCell).Select End With The number of columns and rows are variable. I want to sort the rows. How can I do it? I am working in Excel 2007. Any help is welcome!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sort by color: Is there an easy way to sort columns or rows in EX | Excel Worksheet Functions | |||
Sort Selection | Excel Programming | |||
Object Type of a selection... counting rows in a selection | Excel Programming | |||
Selection.Sort not working? | Excel Programming | |||
Need a macro for selection and sort | Excel Programming |