Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro sort
HI there
Can anybody help me with a simple Macro to sort the sheet according to 3rd column and the number of rows is not known. Please explain about the important part of Macro too. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro sort
Sub Macro1()
n = Cells(Rows.Count, 3).End(xlUp).Row Range("A1:C" & n).Select Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub This just does the first three columns. The first line figures how far down to go. The next lines selects the block to be sorted. The last actually performs the sort. -- Gary''s Student - gsnu200776 "atv" wrote: HI there Can anybody help me with a simple Macro to sort the sheet according to 3rd column and the number of rows is not known. Please explain about the important part of Macro too. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro sort | New Users to Excel | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Using Macro to sort without clicking on macro button | Excel Discussion (Misc queries) | |||
sort macro | Excel Programming | |||
Sort Macro | Excel Programming |